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:
parent
3ac0ec4ecd
commit
f1f609bc22
1 changed files with 6 additions and 5 deletions
|
@ -30,12 +30,13 @@ class TestWeakMap < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_include?
|
def test_include?
|
||||||
m = __callee__[/test_(.*)/, 1]
|
m = __callee__[/test_(.*)/, 1]
|
||||||
x = Object.new
|
|
||||||
k = "foo"
|
k = "foo"
|
||||||
@wm[k] = x
|
Object.new do |x|
|
||||||
assert_send([@wm, m, k])
|
@wm[k] = x
|
||||||
assert_not_send([@wm, m, "FOO".downcase])
|
assert_send([@wm, m, k])
|
||||||
x = nil
|
assert_not_send([@wm, m, "FOO".downcase])
|
||||||
|
x = nil
|
||||||
|
end
|
||||||
GC.start
|
GC.start
|
||||||
assert_not_send([@wm, m, k])
|
assert_not_send([@wm, m, k])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue