summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-02 09:11:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-02 09:11:41 +0900
commitab63f6d8543903f177c46634f38e5428655f003b (patch)
tree2850cb5363edb40d68f8aeb88f60e89a4a4d4b84 /test
parentcb5a41c0a02962da838990853f5d6632d8abb92d (diff)
Refined test [Bug #18140]
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_array.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 4cb49046f1..a97a9c2558 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -656,7 +656,10 @@ class TestArray < Test::Unit::TestCase
assert_raise(FrozenError) { @cls[0].freeze.concat(:foo) }
a = @cls[nil]
- def (x = Object.new).to_ary; Array.new(10) {nil} << :ok; end
+ def (x = Object.new).to_ary
+ ary = Array.new(2)
+ ary << [] << [] << :ok
+ end
EnvUtil.under_gc_stress {a.concat(x)}
GC.start
assert_equal(:ok, a.last)