diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-07 12:03:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-07 12:03:16 +0000 |
commit | d60738f6f1fb182f09a4706852f535f62772c09b (patch) | |
tree | 4ca90cd4a04f27a1942dff105c44eac2506261ae /test | |
parent | 1e9eb839280b8398d693c86c1b7ce4db93bff380 (diff) | |
download | ruby-d60738f6f1fb182f09a4706852f535f62772c09b.tar.gz |
Adjust reserved hash values
The reserved hash values in hash.c must be consistend with st.c.
[ruby-core:90356] [Bug #15389]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_hash.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 7db3c27f87..c934d1015e 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1712,6 +1712,15 @@ class TestHash < Test::Unit::TestCase assert_equal(0, 1_000_000.times.count{a=Object.new.hash; b=Object.new.hash; 0 + a + b != 0 + b + a}, bug14218) end + def test_reserved_hash_val + s = Struct.new(:hash) + h = {} + keys = [*0..8] + keys.each {|i| h[s.new(i)]=true} + msg = proc {h.inspect} + assert_equal(keys, h.keys.map(&:hash), msg) + end + class TestSubHash < TestHash class SubHash < Hash def reject(*) |