summaryrefslogtreecommitdiff
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-02 08:52:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-02 08:52:55 +0000
commit2a6ccf6c136ff7f8311b7a1a0e05081b2e872367 (patch)
tree6c6c4c30e87b742887454916832494548f61d6fb /test/ruby/test_argf.rb
parenta267b9512afdd66498872484d24542c810f65b99 (diff)
* io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.
r34409 breaks replacing ARGV. [ruby-dev:45160] [Bug #5952] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index 1480ce1c41..2f1ddf5391 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -678,6 +678,16 @@ class TestArgf < Test::Unit::TestCase
end
end
+ def test_close_replace
+ ruby('-e', <<-SRC) do |f|
+ ARGF.close
+ ARGV.replace ['#{@t1.path}', '#{@t2.path}', '#{@t3.path}']
+ puts ARGF.read
+ SRC
+ assert_equal("1\n2\n3\n4\n5\n6\n", f.read)
+ end
+ end
+
def test_closed
ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
3.times do