diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb index 0312a1a34c..c2cad36aa4 100644 --- a/test/ruby/test_integer.rb +++ b/test/ruby/test_integer.rb @@ -497,6 +497,10 @@ class TestInteger < Test::Unit::TestCase assert_int_equal(1111_1111_1111_1111_1111_1111_1111_1111, 1111_1111_1111_1111_1111_1111_1111_1111.ceil(1)) assert_int_equal(10**400, (10**400).ceil(1)) + + assert_int_equal(10000000000, 1.ceil(-10), "[Bug #20654]") + assert_int_equal(100000000000000000000, 1.ceil(-20), "[Bug #20654]") + assert_int_equal(100000000000000000000000000000000000000000000000000, 1.ceil(-50), "[Bug #20654]") end def test_truncate @@ -525,10 +529,6 @@ class TestInteger < Test::Unit::TestCase assert_int_equal(1111_1111_1111_1111_1111_1111_1111_1111, 1111_1111_1111_1111_1111_1111_1111_1111.truncate(1)) assert_int_equal(10**400, (10**400).truncate(1)) - - assert_int_equal(10000000000, 1.ceil(-10), "[Bug #20654]") - assert_int_equal(100000000000000000000, 1.ceil(-20), "[Bug #20654]") - assert_int_equal(100000000000000000000000000000000000000000000000000, 1.ceil(-50), "[Bug #20654]") end MimicInteger = Struct.new(:to_int)