aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_float.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r--test/ruby/test_float.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index ac2d84352b..073e382777 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -672,4 +672,12 @@ class TestFloat < Test::Unit::TestCase
assert_equal(0.0, z)
assert_equal(-Float::INFINITY, 1.0/z)
end
+
+ def test_hash_0
+ bug10979 = '[ruby-core:68541] [Bug #10979]'
+ assert_equal(+0.0.hash, -0.0.hash)
+ assert_operator(+0.0, :eql?, -0.0)
+ h = {0.0 => bug10979}
+ assert_equal(bug10979, h[-0.0])
+ end
end