* test/bigdecimal/test_bigdecimal.rb: Add test for mult by nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d21daa2b91
commit
787b98e365
@ -694,6 +694,12 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||||||
assert_kind_of(BigDecimal, BigDecimal.new("3") * 1.quo(3))
|
assert_kind_of(BigDecimal, BigDecimal.new("3") * 1.quo(3))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_mult_with_nil
|
||||||
|
assert_raise(TypeError) {
|
||||||
|
BigDecimal('1.1') * nil
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def test_div
|
def test_div
|
||||||
x = BigDecimal.new((2**100).to_s)
|
x = BigDecimal.new((2**100).to_s)
|
||||||
assert_equal(BigDecimal.new((2**100 / 3).to_s), (x / 3).to_i)
|
assert_equal(BigDecimal.new((2**100 / 3).to_s), (x / 3).to_i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user