mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (argf_eof): go to the next file if called after ARGF.close
or ARGF.skip. [ruby-core:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f9f1581f6d
commit
b7f26835da
3 changed files with 18 additions and 0 deletions
|
@ -437,6 +437,18 @@ class TestArgf < Test::Unit::TestCase
|
|||
assert_equal(x, a.shift)
|
||||
end
|
||||
end
|
||||
|
||||
t1 = Tempfile.new("foo")
|
||||
t1.binmode
|
||||
t1.puts "foo"
|
||||
t1.close
|
||||
t2 = Tempfile.new("bar")
|
||||
t2.binmode
|
||||
t2.puts "bar"
|
||||
t2.close
|
||||
ruby('-e', 'STDERR.reopen(STDOUT); ARGF.gets; ARGF.skip; p ARGF.eof?', t1.path, t2.path) do |f|
|
||||
assert_equal(%w(false), f.read.split(/\n/))
|
||||
end
|
||||
end
|
||||
|
||||
def test_read
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue