diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-16 04:19:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-16 04:19:48 +0000 |
commit | 885c16c1d6d3115a8f88ad197f7f7850cebdb344 (patch) | |
tree | ee0e3f08b2ccc2e009f777efa9764911692055b5 /test/ruby | |
parent | ae0eea21bf52745c6fbb812f9dd4897ae27e36ed (diff) | |
download | ruby-885c16c1d6d3115a8f88ad197f7f7850cebdb344.tar.gz |
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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_complex.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index ab6aaa0d9c..a195e0d4fb 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -835,6 +835,9 @@ class Complex_Test < Test::Unit::TestCase 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::TestCase 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 |