summaryrefslogtreecommitdiff
path: root/test/ruby/test_numeric.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-28 02:04:03 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-28 02:04:03 +0000
commit33335f28f49e88f021d65a0d15f1b315e20cb475 (patch)
treeb1595c118d7199b36788b44e854651b7f9e3bf49 /test/ruby/test_numeric.rb
parente184e31c0956e49df2f121c4a8f024286c894993 (diff)
* 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
Diffstat (limited to 'test/ruby/test_numeric.rb')
-rw-r--r--test/ruby/test_numeric.rb9
1 files changed, 5 insertions, 4 deletions
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