Skip to content

Commit

Permalink
Add specs for [Bug #20654]
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Jul 28, 2024
1 parent f78487f commit 5a3820a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/integer/shared/integer_ceil_precision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@
send(@method, -123).ceil(-2).should.eql?(-100)
send(@method, -123).ceil(-3).should.eql?(0)
end

ruby_bug "#20654", ""..."3.4" do
it "returns 0 when the return value overflows fixnum" do
send(@method, 123).ceil(-100).should.eql?(0)
end
end
end
end
6 changes: 6 additions & 0 deletions core/integer/shared/integer_floor_precision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@
send(@method, -123).floor(-2).should.eql?(-200)
send(@method, -123).floor(-3).should.eql?(-1000)
end

ruby_bug "#20654", ""..."3.4" do
it "returns 0 when the return value overflows fixnum" do
send(@method, -123).ceil(-100).should.eql?(0)
end
end
end
end

0 comments on commit 5a3820a

Please sign in to comment.