summaryrefslogtreecommitdiff
path: root/test/ruby/test_hash.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_hash.rb')
-rw-r--r--test/ruby/test_hash.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 4131a6bdd3..71cf8dab93 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -638,4 +638,15 @@ class TestHash < Test::Unit::TestCase
def test_hash_hash
assert_equal({0=>2,11=>1}.hash, {11=>1,0=>2}.hash)
end
+
+ def test_hash_bignum_hash
+ x = 2<<(32-3)-1
+ assert_equal({x=>1}.hash, {x=>1}.hash)
+ x = 2<<(64-3)-1
+ assert_equal({x=>1}.hash, {x=>1}.hash)
+
+ o = Object.new
+ def o.hash; 2<<100; end
+ assert_equal({x=>1}.hash, {x=>1}.hash)
+ end
end