1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_weakmap.rb: fix test

* test/ruby/test_weakmap.rb (test_include?): isolate weak
  referenced object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-13 13:29:07 +00:00
parent 3ac0ec4ecd
commit f1f609bc22

View file

@ -30,12 +30,13 @@ class TestWeakMap < Test::Unit::TestCase
def test_include?
m = __callee__[/test_(.*)/, 1]
x = Object.new
k = "foo"
@wm[k] = x
assert_send([@wm, m, k])
assert_not_send([@wm, m, "FOO".downcase])
x = nil
Object.new do |x|
@wm[k] = x
assert_send([@wm, m, k])
assert_not_send([@wm, m, "FOO".downcase])
x = nil
end
GC.start
assert_not_send([@wm, m, k])
end