From 33335f28f49e88f021d65a0d15f1b315e20cb475 Mon Sep 17 00:00:00 2001 From: marcandre Date: Fri, 28 Feb 2014 02:04:03 +0000 Subject: * test_numeric: Strengthen tests on 64 bit platforms git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_numeric.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index 25351163b7..223bf92138 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -251,6 +251,7 @@ class TestNumeric < Test::Unit::TestCase end def test_step + bignum = 1 << 100 assert_raise(ArgumentError) { 1.step(10, 1, 0) { } } assert_raise(ArgumentError) { 1.step(10, 1, 0).size } assert_raise(ArgumentError) { 1.step(10, 0) { } } @@ -276,17 +277,17 @@ class TestNumeric < Test::Unit::TestCase assert_step [10, 8, 6, 4, 2], [10, to: 1, by: -2] assert_step [1.0, 3.0, 5.0, 7.0, 9.0], [1.0, 10.0, 2.0] assert_step [1.0, 3.0, 5.0, 7.0, 9.0], [1.0, to: 10.0, by: 2.0] - assert_step [1], [1, 10, 2**32] - assert_step [1], [1, to: 10, by: 2**32] + assert_step [1], [1, 10, bignum] + assert_step [1], [1, to: 10, by: bignum] assert_step [], [2, 1, 3] assert_step [], [-2, -1, -3] assert_step [3, 3, 3, 3], [3, by: 0], inf: true - assert_step [10], [10, 1, -(2**32)] + assert_step [10], [10, 1, -bignum] assert_step [], [1, 0, Float::INFINITY] assert_step [], [0, 1, -Float::INFINITY] - assert_step [10], [10, to: 1, by: -(2**32)] + assert_step [10], [10, to: 1, by: -bignum] assert_step [10, 11, 12, 13], [10], inf: true assert_step [10, 9, 8, 7], [10, by: -1], inf: true -- cgit v1.2.3