summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-08 05:09:39 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-08 05:09:39 +0000
commit583d9edebbd21a0ad01015c509343ab94f04e526 (patch)
tree5c6d22803146a7d9e729ab749034c2ca99979871 /test
parentc58402cde18b956affd34364475549ae67a96da9 (diff)
merge revision(s) 37406: [Backport #7176]
* ext/bigdecimal/bigdecimal.c (BigDecimal_add), test/bigdecimal/test_bigdecimal.rb: need to specify precision for converting Rational and Float. [ruby-core:48045] [Bug #7176] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 e230624028..ed3639f058 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -558,6 +558,10 @@ class TestBigDecimal < Test::Unit::TestCase
a, b = BigDecimal("0.11111").coerce(1.quo(3))
assert_equal(BigDecimal("0." + "3"*a.precs[0]), a)
+
+ assert_nothing_raised(TypeError, '#7176') do
+ BigDecimal.new('1') + Rational(1)
+ end
end
def test_uplus