diff options
| -rw-r--r-- | test/ruby/test_weakmap.rb | 7 | ||||
| -rw-r--r-- | weakmap.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index 4f5823ecf4..2f5c747339 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -39,6 +39,13 @@ class TestWeakMap < Test::Unit::TestCase assert_same(:foo, @wm[x]) end + def test_aset_returns_value + key = Object.new + value = Object.new + + assert_same(value, @wm.send(:[]=, key, value)) + end + def assert_weak_include(m, k, n = 100) if n > 0 return assert_weak_include(m, k, n-1) @@ -394,7 +394,7 @@ wmap_aset(VALUE self, VALUE key, VALUE val) RB_OBJ_WRITTEN(self, Qundef, key); RB_OBJ_WRITTEN(self, Qundef, val); - return Qnil; + return val; } /* Retrieves a weakly referenced object with the given key */ |
