1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2019-02-21 15:38:59 +00:00
parent b8e389a0f3
commit da7976235f
75 changed files with 940 additions and 258 deletions

View file

@ -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")

View file

@ -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