diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_hash.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 1bb32f663e..9ac3614dd8 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -228,6 +228,19 @@ class TestHash < Test::Unit::TestCase assert_same a.keys[0], b.keys[0] end + def test_hash_aset_fstring_identity + h = {}.compare_by_identity + h['abc'] = 1 + h['abc'] = 2 + assert_equal 2, h.size, '[ruby-core:78783] [Bug #12855]' + end + + def test_hash_aref_fstring_identity + h = {}.compare_by_identity + h['abc'] = 1 + assert_nil h['abc'], '[ruby-core:78783] [Bug #12855]' + end + def test_NEWHASH_fstring_key a = {"ABC" => :t} b = {"ABC" => :t} |