diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index 35025c8201..32e321f48e 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -28,9 +28,10 @@ class TestWeakMap < Test::Unit::TestCase assert_raise(ArgumentError) {@wm[x] = :foo} end - def test_include? - m = __callee__[/test_(.*)/, 1] - k = "foo" + def assert_weak_include(m, k, n = 100) + if n > 0 + return assert_weak_include(m, k, n-1) + end 1.times do x = Object.new @wm[k] = x @@ -38,6 +39,14 @@ class TestWeakMap < Test::Unit::TestCase assert_not_send([@wm, m, "FOO".downcase]) x = nil end + end + + def test_include? + m = __callee__[/test_(.*)/, 1] + k = "foo" + 1.times do + assert_weak_include(m, k) + end GC.start # skip('TODO: failure introduced from r60440') assert_not_send([@wm, m, k])