diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_weakmap.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index 9bbe2d6b81..c72e7310db 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -194,4 +194,21 @@ class TestWeakMap < Test::Unit::TestCase GC.compact end; end + + def test_replaced_values_bug_19531 + a = "A".dup + b = "B".dup + + @wm[1] = a + @wm[1] = a + @wm[1] = a + + @wm[1] = b + assert_equal b, @wm[1] + + a = nil + GC.start + + assert_equal b, @wm[1] + end end |