summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-26 10:17:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-26 10:17:39 +0000
commit9a10d0d4f2e83458372a2cc5aeba240c81b67549 (patch)
tree441748b8075458313fb3a1dd4b25b57ca924dfd2 /test/ruby
parent55ade09bbe8a96e2b89927e5096bd61e78fc7eea (diff)
downloadruby-9a10d0d4f2e83458372a2cc5aeba240c81b67549.tar.gz
ruby-9a10d0d4f2e83458372a2cc5aeba240c81b67549.tar.xz
ruby-9a10d0d4f2e83458372a2cc5aeba240c81b67549.zip
* io.c (argf_eof): go to the next file if called after ARGF.close
or ARGF.skip. [ruby-core:24561] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_argf.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index c00db99bf..ed92a516a 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -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