diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-29 09:10:20 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-29 09:10:20 +0000 |
commit | 5925c930a8120ac5033f513a22a891b0329b29b8 (patch) | |
tree | 8ccacb31c9736c1a35bf138f4b3e539c9a5588cc /test | |
parent | 979ba5fc702823b954f5f3aa12702821d7a6481e (diff) |
merge revision(s) 52745: [Backport #11738]
* io.c (argf_getpartial): should not resize str if the second
argument is not given.
[ruby-core:71668] [Bug #11738]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_argf.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index 10da4abeba..19c56146dd 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -510,6 +510,17 @@ class TestArgf < Test::Unit::TestCase end end + def test_readpartial_eof_twice + ruby('-W1', '-e', <<-SRC, @t1.path) do |f| + $stderr = $stdout + print ARGF.readpartial(256) + ARGF.readpartial(256) rescue p($!.class) + ARGF.readpartial(256) rescue p($!.class) + SRC + assert_equal("1\n2\nEOFError\nEOFError\n", f.read) + end + end + def test_getc ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f| s = "" |