aboutsummaryrefslogtreecommitdiffstats
path: root/test/bigdecimal/test_bigdecimal_util.rb
blob: 5f03b734cf5388e695d42229c4cc7193a8c87ed7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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