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?
|
||||
m = __callee__[/test_(.*)/, 1]
|
||||
x = Object.new
|
||||
k = "foo"
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue