From 5a5ea533fd8c5c95ca0dcd5e4cce2558ebba62c5 Mon Sep 17 00:00:00 2001 From: mrkn Date: Sat, 10 Dec 2016 08:56:05 +0000 Subject: 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 --- test/bigdecimal/test_bigdecimal.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index dd22997efd..45a65d8164 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 -- cgit v1.2.3