aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_hash.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 782edc9a0c..4c0d556896 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -890,7 +890,7 @@ class TestHash < Test::Unit::TestCase
assert_equal({x=>1}.hash, {x=>1}.hash)
o = Object.new
- def o.hash; 2<<100; end
+ def o.hash; 2 << 100; end
assert_equal({x=>1}.hash, {x=>1}.hash)
end
@@ -904,4 +904,11 @@ class TestHash < Test::Unit::TestCase
h.rehash
assert_equal(:foo, h[h])
end
+
+ def test_inverse_hash
+ feature4262 = '[ruby-core:34334]'
+ [{1=>2}, {123=>"abc"}].each do |h|
+ assert_not_equal(h.hash, h.invert.hash, feature4262)
+ end
+ end
end