summaryrefslogtreecommitdiff
path: root/spec/ruby/core/float
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2021-10-20 21:41:46 +0200
committerBenoit Daloze <[email protected]>2021-10-20 21:41:46 +0200
commita6c6eef04aaa075f4bbd0eef740d011737afec91 (patch)
treee8779ca2ddc044899caabca88c16abc9a9054fff /spec/ruby/core/float
parent207a5a5bc13018344dc2ab7913fdcaeaeca01292 (diff)
Update to ruby/spec@d6921ef
Diffstat (limited to 'spec/ruby/core/float')
-rw-r--r--spec/ruby/core/float/comparison_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/float/comparison_spec.rb b/spec/ruby/core/float/comparison_spec.rb
index a46841ffbf..53e7ec332a 100644
--- a/spec/ruby/core/float/comparison_spec.rb
+++ b/spec/ruby/core/float/comparison_spec.rb
@@ -90,4 +90,19 @@ describe "Float#<=>" do
end
(infinity_value <=> obj).should == 1
end
+
+ it "returns 0 for -0.0 and 0.0" do
+ (-0.0 <=> 0.0).should == 0
+ (0.0 <=> -0.0).should == 0
+ end
+
+ it "returns 0 for -0.0 and 0" do
+ (-0.0 <=> 0).should == 0
+ (0 <=> -0.0).should == 0
+ end
+
+ it "returns 0 for 0.0 and 0" do
+ (0.0 <=> 0).should == 0
+ (0 <=> 0.0).should == 0
+ end
end