summaryrefslogtreecommitdiff
path: root/test/bigdecimal/test_bigdecimal.rb
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-01 13:03:53 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-01 13:03:53 +0000
commit2e6b5ece958d6bfb389d2b0cb9fedce0e733214f (patch)
tree346b8d2e649faa167ca8ebdefb77fc02fd0b6855 /test/bigdecimal/test_bigdecimal.rb
parenta5fc96a5c12b347c9b78949810bca245f48a1bec (diff)
* 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/trunk@37406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-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 856281d046..e1f98a28ca 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -587,6 +587,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