summaryrefslogtreecommitdiff
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-29 07:51:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-29 07:51:43 +0000
commit824cb6905896131031c4f712e6cb55f76fc9ad1f (patch)
treecbcf54ad82ad4bf9b278243baf5a5a3b5b180d17 /test/ruby/test_argf.rb
parent8d7c52dbe21f1bbd423860c7bab21a9f8ce487c2 (diff)
io.c: get rid of IOError when skipped while iteration
* io.c (argf_next_argv): set init flag if succeeded to forward, after skipping. * io.c (argf_block_call_i, argf_block_call): no more forwarding if forwarded after skipping. [ruby-list:49185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index 979b66765b..1abcd604fd 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -689,6 +689,11 @@ class TestArgf < Test::Unit::TestCase
SRC
assert_equal("1\n3\n5\n", f.read, '[ruby-list:49185]')
end
+ ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
+ ARGF.each_line {|l| ARGF.skip; puts [l, ARGF.gets].map {|s| s ? s.chomp : s.inspect}.join("+")}
+ SRC
+ assert_equal("1+3\n4+5\n6+nil\n", f.read, '[ruby-list:49185]')
+ end
end
def test_skip_in_each_byte