diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-10 22:06:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-10 23:40:45 +0900 |
commit | c3964a313eaf8ba8ebaef36bf3c3a5df599fca34 (patch) | |
tree | 34779f54ca9e435b3f3699efcfcf332c8422eae7 /test/ruby/test_argf.rb | |
parent | 7de7e9fdb7ef78c3fbd62d1b34ae1e4ee89cf7a9 (diff) |
Assert for duplicated ARGF [Bug #18074]
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r-- | test/ruby/test_argf.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index 3c9b1c63fc..e3bd1cd075 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -1121,5 +1121,12 @@ class TestArgf < Test::Unit::TestCase ruby('-e', "print ARGF.read(3)", @t1.path, @t2.path, @t3.path) do |f| assert_equal("abc", f.read) end + + argf = ARGF.class.new(@t1.path, @t2.path, @t3.path) + begin + assert_equal("abc", argf.read(3)) + ensure + argf.close + end end end |