mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
Make Integer#round spec work regardless of pointer size
The spec is actually testing a behaviour stemming from NUM2INT(), and since `sizeof(long)>=sizeof(int)`, `min_long-1` always makes NUM2INT() raise `RangeError`.
This commit is contained in:
parent
28382505b2
commit
d08e55141e
Notes:
git
2024-07-24 16:20:48 +00:00
1 changed files with 2 additions and 4 deletions
|
@ -21,10 +21,8 @@ describe "Integer#round" do
|
||||||
(-25 * 10**70).round(-71).should eql(-30 * 10**70)
|
(-25 * 10**70).round(-71).should eql(-30 * 10**70)
|
||||||
end
|
end
|
||||||
|
|
||||||
platform_is_not wordsize: 32 do
|
|
||||||
it "raises a RangeError when passed a big negative value" do
|
it "raises a RangeError when passed a big negative value" do
|
||||||
-> { 42.round(fixnum_min) }.should raise_error(RangeError)
|
-> { 42.round(min_long - 1) }.should raise_error(RangeError)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises a RangeError when passed Float::INFINITY" do
|
it "raises a RangeError when passed Float::INFINITY" do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue