mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
more GCable
* test/test_weakref.rb (make_weakref): more GCable, probably. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cb1d290886
commit
4bce9fc7bd
1 changed files with 4 additions and 2 deletions
|
@ -2,9 +2,11 @@ require 'test/unit'
|
|||
require 'weakref'
|
||||
|
||||
class TestWeakRef < Test::Unit::TestCase
|
||||
def make_weakref
|
||||
def make_weakref(level = 10)
|
||||
obj = Object.new
|
||||
return WeakRef.new(obj), obj.to_s
|
||||
str = obj.to_s
|
||||
level.times {obj = WeakRef.new(obj)}
|
||||
return WeakRef.new(obj), str
|
||||
end
|
||||
|
||||
def test_ref
|
||||
|
|
Loading…
Reference in a new issue