mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c (count_objects): clear given hash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c6bac86887
commit
fa58f951cf
3 changed files with 22 additions and 0 deletions
|
|
@ -47,5 +47,11 @@ End
|
|||
assert(h.values.all? {|x| x.is_a?(Integer) })
|
||||
|
||||
assert_raise(TypeError) { ObjectSpace.count_objects(1) }
|
||||
|
||||
h0 = {:T_FOO=>1000}
|
||||
h = ObjectSpace.count_objects(h0)
|
||||
p h0.equal?(h)
|
||||
assert_same(h0, h)
|
||||
assert_equal(0, h0[:T_FOO])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue