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

ruby-changes:32494

From: nobu <ko1@a...>
Date: Sun, 12 Jan 2014 17:20:42 +0900 (JST)
Subject: [ruby-changes:32494] nobu:r44573 (trunk): test_bigmath.rb: ignore on unrelated platforms

nobu	2014-01-12 17:20:39 +0900 (Sun, 12 Jan 2014)

  New Revision: 44573

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

  Log:
    test_bigmath.rb: ignore on unrelated platforms
    
    * test/bigdecimal/test_bigmath.rb (test_log): ignore the result of log
      which is not a finite number.

  Modified files:
    trunk/test/bigdecimal/test_bigmath.rb
Index: test/bigdecimal/test_bigmath.rb
===================================================================
--- test/bigdecimal/test_bigmath.rb	(revision 44572)
+++ test/bigdecimal/test_bigmath.rb	(revision 44573)
@@ -68,7 +68,14 @@ class TestBigMath < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/bigdecimal/test_bigmath.rb#L68
     assert_raise(Math::DomainError) {BigMath.log(BigDecimal("0"), 10)}
     assert_raise(Math::DomainError) {BigMath.log(BigDecimal("-1"), 10)}
     assert_separately(%w[-rbigdecimal], <<-SRC)
-    assert_in_epsilon(Math.log(10)*19999999999999, BigMath.log(BigDecimal("1E19999999999999"), 10))
+    begin
+      x = BigMath.log(BigDecimal("1E19999999999999"), 10)
+    rescue FloatDomainError
+    else
+      unless x.infinite?
+        assert_in_epsilon(Math.log(10)*19999999999999, x)
+      end
+    end
     SRC
   end
 end

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

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