aboutsummaryrefslogtreecommitdiffstats
path: root/test/bigdecimal
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-11 14:03:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-11 14:03:38 +0000
commit2f56c64b4f4686e7a5adac3dc486319694ad2828 (patch)
treed35c146ecdcf0980444ba82c2725c01af20e2be0 /test/bigdecimal
parent4bbb0f9801a2d3ff3635078cb38e1b4922f32573 (diff)
downloadruby-2f56c64b4f4686e7a5adac3dc486319694ad2828.tar.gz
Add a test: BigDecimal("0").div(BigDecimal("Infinity")).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 9d160dafbe..d440e4cedb 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -668,6 +668,10 @@ class TestBigDecimal < Test::Unit::TestCase
assert_equal(400000000000000000000000000000, x.div(3, 1))
assert_equal(420000000000000000000000000000, x.div(3, 2))
assert_equal(423000000000000000000000000000, x.div(3, 3))
+ BigDecimal.save_exception_mode do
+ BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false)
+ assert_equal(0, BigDecimal("0").div(BigDecimal("Infinity")))
+ end
end
def test_abs_bigdecimal