summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-09-23 21:59:35 +0900
committerKOBAYASHI Shuji <[email protected]>2019-09-23 21:59:35 +0900
commit549317a36b239cbe51a75b4cdb4abd49298773e8 (patch)
treec9a35652ca9c9855022c50f8543765c0582adcb3 /test
parenta4f2e1276ce028e39c5f32f417946ae50235152d (diff)
downloadmruby-549317a36b239cbe51a75b4cdb4abd49298773e8.tar.gz
mruby-549317a36b239cbe51a75b4cdb4abd49298773e8.zip
Fix `Fixnum` overflow test in `Integer#<<` test
- Skip when `MRB_WITHOUT_FLOAT` is defined. - Make `Fixnum` overflow even when `MRB_INT64` is defined.
Diffstat (limited to 'test')
-rw-r--r--test/t/integer.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/t/integer.rb b/test/t/integer.rb
index bd7efa855..f9c44a64f 100644
--- a/test/t/integer.rb
+++ b/test/t/integer.rb
@@ -154,11 +154,11 @@ assert('Integer#<<', '15.2.8.3.12') do
# Left Shift by a negative is Right Shift
assert_equal 23, 46 << -1
- # Left Shift by 31 is bitShift overflow to SignedInt
- assert_equal 2147483648, 1 << 31
+ skip unless Object.const_defined?(:Float)
- # -3 Left Shift by 30 is bitShift overflow to SignedInt
- assert_equal(-3221225472, -3 << 30)
+ # Overflow to Fixnum
+ assert_float 9223372036854775808.0, 1 << 63
+ assert_float(-13835058055282163712.0, -3 << 62)
end
assert('Integer#>>', '15.2.8.3.13') do