summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-10 07:09:00 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-10 07:09:00 +0000
commit0a619ef7efdaa8001bb4a9b028e2b35174ce66bb (patch)
treec7f882474ada595348d2a19ab266d9b9acc47971 /test
parentf1cae09ec42bebfaedd6d65131a43163a3225f1f (diff)
merge revision(s) 55123,55129,55130,55133,55136: [Backport #12414]
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider non-finite float values not to raise FloatDomainError. [ruby-core:75682] [Bug #12414] * ext/bigdecimal/bigdecimal.c (isfinite): isfinite does not always exist. fixed build error on Windows itroduced at r55123. exist. fixed build error on Windows introduced at r55123. * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on cygwin. [Bug #12417][ruby-core:75691] * include/ruby/missing.h (isfinite): move from numeric.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 042d11da0f..b498df4601 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -458,6 +458,18 @@ class TestBigDecimal < Test::Unit::TestCase
assert_equal(false, BigDecimal.new("NaN") > n1)
end
+ def test_cmp_float_nan
+ assert_equal(nil, BigDecimal.new("1") <=> Float::NAN)
+ end
+
+ def test_cmp_float_pos_inf
+ assert_equal(-1, BigDecimal.new("1") <=> Float::INFINITY)
+ end
+
+ def test_cmp_float_neg_inf
+ assert_equal(+1, BigDecimal.new("1") <=> -Float::INFINITY)
+ end
+
def test_cmp_failing_coercion
n1 = BigDecimal.new("1")
assert_equal(nil, n1 <=> nil)