From 9bd802f5567d78551668c51f091deb05e43b97ea Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 10 Dec 2013 05:02:17 +0000 Subject: 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 --- test/ruby/test_weakmap.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index c0d1747d2a..0f147a6b0f 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -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\#\s=>\s\#>\z/, + @wm.inspect) + end + def test_each m = __callee__[/test_(.*)/, 1] x1 = Object.new -- cgit v1.2.3