diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 122e63da3a..1fa9dbb443 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1225,6 +1225,20 @@ class TestIO < Test::Unit::TestCase end) end + def test_write_with_multiple_arguments_and_buffer + mkcdtmpdir do + line = "x"*9+"\n" + file = "test.out" + open(file, "wb") do |w| + w.write(line) + assert_equal(11, w.write(line, "\n")) + end + open(file, "rb") do |r| + assert_equal([line, line, "\n"], r.readlines) + end + end + end + def test_write_with_many_arguments [1023, 1024].each do |n| pipe(proc do |w| |
