diff options
Diffstat (limited to 'test/ruby/test_weakmap.rb')
| -rw-r--r-- | test/ruby/test_weakmap.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index 86550cc221..9bbe2d6b81 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -176,4 +176,22 @@ class TestWeakMap < Test::Unit::TestCase end end; end + + def test_compaction_bug_19529 + obj = Object.new + 100.times do |i| + GC.compact + @wm[i] = obj + end + + assert_separately(%w(--disable-gems), <<-'end;') + wm = ObjectSpace::WeakMap.new + obj = Object.new + 100.times do + wm[Object.new] = obj + GC.start + end + GC.compact + end; + end end |
