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

ruby-changes:14513

From: mame <ko1@a...>
Date: Tue, 19 Jan 2010 02:05:15 +0900 (JST)
Subject: [ruby-changes:14513] Ruby:r26350 (trunk): * test/ruby/test_bignum.rb: some coerce definitions (for test) was

mame	2010-01-19 02:00:55 +0900 (Tue, 19 Jan 2010)

  New Revision: 26350

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

  Log:
    * test/ruby/test_bignum.rb: some coerce definitions (for test) was
      wrong.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_bignum.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26349)
+++ ChangeLog	(revision 26350)
@@ -1,3 +1,8 @@
+Tue Jan 19 01:57:12 2010  Yusuke Endoh  <mame@t...>
+
+	* test/ruby/test_bignum.rb: some coerce definitions (for test) was
+	  wrong.
+
 Tue Jan 19 01:53:11 2010  Yusuke Endoh  <mame@t...>
 
 	* bignum.c (bigsub_int): remove nonsense loop.
Index: test/ruby/test_bignum.rb
===================================================================
--- test/ruby/test_bignum.rb	(revision 26349)
+++ test/ruby/test_bignum.rb	(revision 26350)
@@ -208,8 +208,9 @@
     assert_equal(-1, (x+1) - (x+2))
     assert_equal(0, (2**100) - (2.0**100))
     o = Object.new
-    def o.coerce(x); [2**100+2, x]; end
-    assert_equal(1, (2**100+1) - o)
+    def o.coerce(x); [x, 2**100+2]; end
+    assert_equal(-1, (2**100+1) - o)
+    assert_equal(-1, T_ONE - 2)
   end
 
   def test_plus
@@ -219,7 +220,7 @@
     assert_equal(1267651809154049016125877911552, (2**80) + (2**100))
     assert_equal(2**101, (2**100) + (2.0**100))
     o = Object.new
-    def o.coerce(x); [2**80, x]; end
+    def o.coerce(x); [x, 2**80]; end
     assert_equal(1267651809154049016125877911552, (2**100) + o)
   end
 
@@ -232,7 +233,7 @@
     assert_equal(T32.to_f, T32 * 1.0)
     assert_raise(TypeError) { T32 * "foo" }
     o = Object.new
-    def o.coerce(x); [2**100, x]; end
+    def o.coerce(x); [x, 2**100]; end
     assert_equal(2**180, (2**80) * o)
   end
 

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

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