diff options
Diffstat (limited to 'test/ruby/test_weakmap.rb')
-rw-r--r-- | test/ruby/test_weakmap.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index b42787ad5e..a30004bce3 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -223,6 +223,18 @@ class TestWeakMap < Test::Unit::TestCase assert_equal(val, wm[key]) end; + + assert_separately(["-W0"], <<-'end;') + wm = ObjectSpace::WeakMap.new + + ary = 10_000.times.map do + o = Object.new + wm[o] = 1 + o + end + + GC.verify_compaction_references(expand_heap: true, toward: :empty) + end; end def test_replaced_values_bug_19531 |