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

ruby-changes:48074

From: nobu <ko1@a...>
Date: Mon, 16 Oct 2017 13:19:52 +0900 (JST)
Subject: [ruby-changes:48074] nobu:r60188 (trunk): test_complex.rb: NaN Complex

nobu	2017-10-16 13:19:48 +0900 (Mon, 16 Oct 2017)

  New Revision: 60188

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

  Log:
    test_complex.rb: NaN Complex
    
    * test/ruby/test_complex.rb (test_finite_p): assertions for NaN
      Complex.  NaN is not an infinite nor a finite number.
      [ruby-core:83272] [Bug #14014]

  Modified files:
    trunk/test/ruby/test_complex.rb
Index: test/ruby/test_complex.rb
===================================================================
--- test/ruby/test_complex.rb	(revision 60187)
+++ test/ruby/test_complex.rb	(revision 60188)
@@ -835,6 +835,9 @@ class Complex_Test < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/ruby/test_complex.rb#L835
     assert_predicate(Complex(Float::MAX, 0.0), :finite?)
     assert_predicate(Complex(0.0, Float::MAX), :finite?)
     assert_predicate(Complex(Float::MAX, Float::MAX), :finite?)
+    assert_not_predicate(Complex(Float::NAN, 0), :finite?)
+    assert_not_predicate(Complex(0, Float::NAN), :finite?)
+    assert_not_predicate(Complex(Float::NAN, Float::NAN), :finite?)
   end
 
   def test_infinite_p
@@ -853,6 +856,9 @@ class Complex_Test < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/ruby/test_complex.rb#L856
     assert_nil(Complex(Float::MAX, 0.0).infinite?)
     assert_nil(Complex(0.0, Float::MAX).infinite?)
     assert_nil(Complex(Float::MAX, Float::MAX).infinite?)
+    assert_nil(Complex(Float::NAN, 0).infinite?)
+    assert_nil(Complex(0, Float::NAN).infinite?)
+    assert_nil(Complex(Float::NAN, Float::NAN).infinite?)
   end
 
   def test_supp

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

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