summaryrefslogtreecommitdiff
path: root/test/bigdecimal
diff options
context:
space:
mode:
Diffstat (limited to 'test/bigdecimal')
-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 f10c50b47a..4296b50c59 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -459,6 +459,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)