summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-07 05:11:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-07 05:11:46 +0000
commit23488589b38f09a95e7ba61a72b12358ad6185cb (patch)
treea9e848750fffdea22e2860c4e3825479e2a8abc0 /test/ruby/test_io.rb
parent1598b5e7b343b6c05e6cab47ac3878276aea6d37 (diff)
downloadruby-23488589b38f09a95e7ba61a72b12358ad6185cb.tar.gz
io.c: chomp CR at the end of read buffer
* io.c (rb_io_getline_fast): chomp CR followed by LF but separated by the read buffer boundary. [ruby-core:91707] [Bug #15642] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index c83dc1c30d..f646c41a69 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -233,6 +233,19 @@ class TestIO < Test::Unit::TestCase
assert_nil r.gets
r.close
end)
+
+ (0..3).each do |i|
+ pipe(proc do |w|
+ w.write("a" * ((4096 << i) - 4), "\r\n" "a\r\n")
+ w.close
+ end,
+ proc do |r|
+ r.gets
+ assert_equal "a", r.gets(chomp: true)
+ assert_nil r.gets
+ r.close
+ end)
+ end
end
def test_gets_chomp_rs_nil