summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-01 01:13:57 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-01 05:10:34 +0900
commit814f52a9ebd035ec6e20641c602fa42f64b5dbe0 (patch)
tree24751aeeb19b9d097a26a5c587e01fbe12de6a79 /test
parentb82c06a711cbd1f812251a15c1e864027abe8c37 (diff)
downloadruby-814f52a9ebd035ec6e20641c602fa42f64b5dbe0.tar.gz
[Bug #19624] Hide internal IO for backquote
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_system.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 31c9cd7654..3fcdaa6aad 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -146,6 +146,19 @@ class TestSystem < Test::Unit::TestCase
end
end
+ def test_system_closed
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ begin;
+ ios = []
+ ObjectSpace.each_object(IO) {|io| ios << io}
+ `echo`
+ ObjectSpace.each_object(IO) do |io|
+ next if ios.include?(io)
+ assert_nothing_raised {io.close}
+ end
+ end;
+ end
+
def test_empty_evstr
assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__), "[ruby-dev:25113]")
end