From da7976235fbc2986925969646071bebe3702e49f Mon Sep 17 00:00:00 2001 From: eregon Date: Thu, 21 Feb 2019 15:38:59 +0000 Subject: Update to ruby/spec@7a16e01 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/core/integer/div_spec.rb | 8 ++++++++ spec/ruby/core/integer/uminus_spec.rb | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'spec/ruby/core/integer') diff --git a/spec/ruby/core/integer/div_spec.rb b/spec/ruby/core/integer/div_spec.rb index 9329f5062e..ca69ff4681 100644 --- a/spec/ruby/core/integer/div_spec.rb +++ b/spec/ruby/core/integer/div_spec.rb @@ -81,6 +81,14 @@ describe "Integer#div" do (10**50).div(-(10**40 + 1)).should == -10000000000 end + it "handles fixnum_min / -1" do + (fixnum_min / -1).should == -fixnum_min + (fixnum_min / -1).should > 0 + + int_min = -2147483648 + (int_min / -1).should == 2147483648 + end + it "calls #coerce and #div if argument responds to #coerce" do x = mock("x") y = mock("y") diff --git a/spec/ruby/core/integer/uminus_spec.rb b/spec/ruby/core/integer/uminus_spec.rb index 56c5f7a085..b6b110dec4 100644 --- a/spec/ruby/core/integer/uminus_spec.rb +++ b/spec/ruby/core/integer/uminus_spec.rb @@ -11,8 +11,10 @@ describe "Integer#-@" do end it "negates self at Fixnum/Bignum boundaries" do - fixnum_max.send(:-@).should == (0 - fixnum_max) - fixnum_min.send(:-@).should == (0 - fixnum_min) + (-fixnum_max).should == (0 - fixnum_max) + (-fixnum_max).should < 0 + (-fixnum_min).should == (0 - fixnum_min) + (-fixnum_min).should > 0 end end -- cgit v1.2.3