diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-14 11:55:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-14 11:55:07 +0000 |
commit | e3c023337cf97487d9f6b970014b45adf9708bc2 (patch) | |
tree | 8b0546e283e505ec4b192c5b99faec12670c60e8 /test | |
parent | c05fa459bb9f77c4fecdd230e8d1379cc997975e (diff) | |
download | ruby-e3c023337cf97487d9f6b970014b45adf9708bc2.tar.gz |
test_weakmap.rb: fixing CI failures
* test/ruby/test_weakmap.rb (test_include?): create and release
the object to be garbage-collected in deeper frame.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_weakmap.rb | 15 |
1 files changed, 12 insertions, 3 deletions
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]) |