aboutsummaryrefslogtreecommitdiffstats
path: root/test/bigdecimal
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-26 15:46:42 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-26 15:46:42 +0000
commit2fcb91c74c18680fed4c4067bda6aab60abb5de2 (patch)
tree0ab55df441bf98f3d51964045d4780fe82b2ce0d /test/bigdecimal
parent5ba05758fe549404a5b64fba6418278d16be8cec (diff)
downloadruby-2fcb91c74c18680fed4c4067bda6aab60abb5de2.tar.gz
* ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
for symmetry to BigDecimal() function with an Integer. fixes #5098. [ruby-dev:44210] * test/bigdecimal/test_bigdecimal_util.rb: add test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal')
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal_util.rb b/test/bigdecimal/test_bigdecimal_util.rb
index c4483715ea..5f03b734cf 100644
--- a/test/bigdecimal/test_bigdecimal_util.rb
+++ b/test/bigdecimal/test_bigdecimal_util.rb
@@ -7,4 +7,9 @@ class TestBigDecimalUtil < Test::Unit::TestCase
x = BigDecimal(1)
assert_same(x, x.to_d)
end
+
+ def test_Integer_to_d
+ assert_equal(BigDecimal(1), 1.to_d)
+ assert_equal(BigDecimal(2<<100), (2<<100).to_d)
+ end
end