summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-27 05:28:55 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-27 05:28:55 +0000
commit0c3b3e9237e8fae4bdfd9e577b1f6275918e1abb (patch)
tree6e17d836d0973f47364e275a7e3894c49f16dddc /test
parent26e969182ba3ccc35e611800ece366b4b106c755 (diff)
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_hash.rb6
1 files changed, 6 insertions, 0 deletions
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 ]