1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

gc.c: fix WeakMap#inspect

* gc.c (wmap_inspect_i): fix key/value order.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-10 05:02:17 +00:00
parent 332decb490
commit 9bd802f556
2 changed files with 10 additions and 2 deletions

View file

@ -28,6 +28,14 @@ class TestWeakMap < Test::Unit::TestCase
alias test_member? test_include?
alias test_key? test_include?
def test_inspect
x = Object.new
k = BasicObject.new
@wm[k] = x
assert_match(/\A\#<#{@wm.class.name}:[^:]+:\s\#<BasicObject:[^:]*>\s=>\s\#<Object:[^:]*>>\z/,
@wm.inspect)
end
def test_each
m = __callee__[/test_(.*)/, 1]
x1 = Object.new