aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-06 04:39:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-06 04:39:37 +0000
commit71a3cb13eb588abca4833b2a34d48681de90b9fe (patch)
treea03f2cbf0a8d985169848b1e51617e701a5912cd /test
parent68a063687a693e3c18a51700031de66dfdee6e85 (diff)
downloadruby-71a3cb13eb588abca4833b2a34d48681de90b9fe.tar.gz
io.c: not shorten buffer unless succeeded
* io.c (io_setstrbuf, io_read): should not shorten the given buffer until read succeeds. [ruby-core:55951] [Bug #8625] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index dca78603c7..fab142a5ee 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1230,6 +1230,14 @@ class TestIO < Test::Unit::TestCase
t.value
assert_equal("", s)
end
+ with_pipe do |r, w|
+ s = "xxx"
+ t = Thread.new {r.read(2, s)}
+ Thread.pass until t.stop?
+ t.kill
+ t.value
+ assert_equal("xxx", s)
+ end
end
def test_write_nonblock