From 2f56c64b4f4686e7a5adac3dc486319694ad2828 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 11 May 2012 14:03:38 +0000 Subject: [PATCH] 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 --- test/bigdecimal/test_bigdecimal.rb | 4 ++++ 1 file changed, 4 insertions(+) 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