aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-23 05:28:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-23 05:28:12 +0000
commit209f1e75308c78667a5a241d331dfa97ddfce864 (patch)
tree5415979281288379ef68db9efe01756d7edb5594 /test/ruby
parentf1950ffa079d3a69de2a254c00ed65ec4b6cd6f4 (diff)
downloadruby-209f1e75308c78667a5a241d331dfa97ddfce864.tar.gz
io.c: fix infinite retry
* io.c (io_binwritev): fix infinite retry when flushing buffered data. [Feature #9323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 1fa9dbb443..c7de83784b 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1236,6 +1236,16 @@ class TestIO < Test::Unit::TestCase
open(file, "rb") do |r|
assert_equal([line, line, "\n"], r.readlines)
end
+
+ line = "x"*99+"\n"
+ open(file, "wb") do |w|
+ w.write(line*81) # 8100 bytes
+ assert_equal(100, w.write("a"*99, "\n"))
+ end
+ open(file, "rb") do |r|
+ 81.times {assert_equal(line, r.gets)}
+ assert_equal("a"*99+"\n", r.gets)
+ end
end
end