1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/bigdecimal/test_bigdecimal_util.rb
mrkn 2fcb91c74c * 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
2011-07-26 15:46:42 +00:00

15 lines
313 B
Ruby

require_relative "testbase"
require 'bigdecimal/util'
class TestBigDecimalUtil < Test::Unit::TestCase
def test_BigDecimal_to_d
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