1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
marcandre 2014-02-28 02:04:03 +00:00
parent e184e31c09
commit 33335f28f4

View file

@ -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