[前][次][番号順一覧][スレッド一覧]

ruby-changes:33127

From: marcandre <ko1@a...>
Date: Fri, 28 Feb 2014 11:04:06 +0900 (JST)
Subject: [ruby-changes:33127] marcandRe: r45206 (trunk): * test_numeric: Strengthen tests on 64 bit platforms

marcandre	2014-02-28 11:04:03 +0900 (Fri, 28 Feb 2014)

  New Revision: 45206

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45206

  Log:
    * test_numeric: Strengthen tests on 64 bit platforms

  Modified files:
    trunk/test/ruby/test_numeric.rb
Index: test/ruby/test_numeric.rb
===================================================================
--- test/ruby/test_numeric.rb	(revision 45205)
+++ test/ruby/test_numeric.rb	(revision 45206)
@@ -251,6 +251,7 @@ class TestNumeric < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_numeric.rb#L251
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_numeric.rb#L277
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]