From 0c3b3e9237e8fae4bdfd9e577b1f6275918e1abb Mon Sep 17 00:00:00 2001 From: tmm1 Date: Wed, 27 Nov 2013 05:28:55 +0000 Subject: * hash.c (hash_aset_str): Use rb_fstring() to de-duplicate hash string keys. Patch by Eric Wong. [Bug #8998] [ruby-core:57727] * test/ruby/test_hash.rb (class TestHash): test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 5f72dec5f4..49b74c7257 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -209,6 +209,12 @@ class TestHash < Test::Unit::TestCase assert_equal(256, h[z]) end + def test_ASET_string + a = {"ABC" => :t} + b = {"ABC" => :t} + assert_equal a.keys[0].object_id, b.keys[0].object_id + end + def test_EQUAL # '==' h1 = @cls[ "a" => 1, "c" => 2 ] h2 = @cls[ "a" => 1, "c" => 2, 7 => 35 ] -- cgit v1.2.3