mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
gc.c: fix arity
* gc.c (Init_GC): fix arity of key? method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
14c08fdb88
commit
6bf78ee633
2 changed files with 3 additions and 1 deletions
2
gc.c
2
gc.c
|
@ -6257,7 +6257,7 @@ Init_GC(void)
|
|||
rb_define_method(rb_cWeakMap, "[]", wmap_aref, 1);
|
||||
rb_define_method(rb_cWeakMap, "include?", wmap_has_key, 1);
|
||||
rb_define_method(rb_cWeakMap, "member?", wmap_has_key, 1);
|
||||
rb_define_method(rb_cWeakMap, "key?", wmap_has_key, 0);
|
||||
rb_define_method(rb_cWeakMap, "key?", wmap_has_key, 1);
|
||||
rb_define_method(rb_cWeakMap, "inspect", wmap_inspect, 0);
|
||||
rb_define_method(rb_cWeakMap, "each", wmap_each, 0);
|
||||
rb_define_method(rb_cWeakMap, "each_pair", wmap_each, 0);
|
||||
|
|
|
@ -18,9 +18,11 @@ class TestWeakRef < Test::Unit::TestCase
|
|||
def test_recycled
|
||||
weak, str = make_weakref
|
||||
assert_nothing_raised(WeakRef::RefError) {weak.to_s}
|
||||
assert_predicate(weak, :weakref_alive?)
|
||||
ObjectSpace.garbage_collect
|
||||
ObjectSpace.garbage_collect
|
||||
assert_raise(WeakRef::RefError) {weak.to_s}
|
||||
assert_not_predicate(weak, :weakref_alive?)
|
||||
end
|
||||
|
||||
def test_not_reference_different_object
|
||||
|
|
Loading…
Reference in a new issue