summaryrefslogtreecommitdiff
path: root/test/bigdecimal/test_bigdecimal.rb
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-10 08:56:05 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-10 08:56:05 +0000
commit42a677c895f82bcd611db2773fbe68b0558b142d (patch)
tree0179e2da7b958e6af1ea510298c061f62c4f6119 /test/bigdecimal/test_bigdecimal.rb
parent30540c567569d3486ccbf59b59d903d5778f04d5 (diff)
bigdecimal: version 1.3.0.pre.2
Import bigdecimal version 1.3.0.pre.2. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.0.pre...v1.3.0.pre.2 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index dd22997..45a65d8 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -53,6 +53,15 @@ class TestBigDecimal < Test::Unit::TestCase
assert_equal(1, BigDecimal("1"))
assert_equal(1, BigDecimal("1", 1))
assert_raise(ArgumentError) { BigDecimal("1", -1) }
+
+ BigDecimal.save_exception_mode do
+ BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
+ BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
+ assert_equal(1234, BigDecimal(" \t\n\r \r1234 \t\n\r \r"))
+ assert_positive_infinite(BigDecimal(" \t\n\r \rInfinity \t\n\r \r"))
+ assert_negative_infinite(BigDecimal(" \t\n\r \r-Infinity \t\n\r \r"))
+ assert_nan(BigDecimal(" \t\n\r \rNaN \t\n\r \r"))
+ end
end
def test_global_new_with_invalid_string