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

ruby-changes:35553

From: nobu <ko1@a...>
Date: Fri, 19 Sep 2014 10:47:20 +0900 (JST)
Subject: [ruby-changes:35553] nobu:r47635 (trunk): test_math.rb: use Float#infinite?

nobu	2014-09-19 10:47:06 +0900 (Fri, 19 Sep 2014)

  New Revision: 47635

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

  Log:
    test_math.rb: use Float#infinite?
    
    * test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite?
      returns true also for NaN, so use Float#infinite? instead.
      [ruby-core:65117] [Feature #10261]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_math.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47634)
+++ ChangeLog	(revision 47635)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Sep 19 10:47:03 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite?
+	  returns true also for NaN, so use Float#infinite? instead.
+	  [ruby-core:65117] [Feature #10261]
+
 Fri Sep 19 05:36:16 2014  Eric Wong  <e@8...>
 
 	* NEWS: note --with-jemalloc option [ci skip]
Index: test/ruby/test_math.rb
===================================================================
--- test/ruby/test_math.rb	(revision 47634)
+++ test/ruby/test_math.rb	(revision 47635)
@@ -3,7 +3,7 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_math.rb#L3
 class TestMath < Test::Unit::TestCase
   def assert_infinity(a, *rest)
     rest = ["not infinity: #{a.inspect}"] if rest.empty?
-    assert_not_predicate(a, :finite?, *rest)
+    assert_predicate(a, :infinite?, *rest)
   end
 
   def assert_nan(a, *rest)

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

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