From d60738f6f1fb182f09a4706852f535f62772c09b Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 Dec 2018 12:03:16 +0000 Subject: 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 --- test/ruby/test_hash.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_hash.rb') 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(*) -- cgit v1.2.3