diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-06 03:01:52 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-06 03:01:52 +0000 |
commit | e41936441bf9fcab9fb4d8ceb70cc73d2a38c9c0 (patch) | |
tree | 079b00fe5c87f81371b67a62a59dadf5258229c9 /test | |
parent | 2ff26f22209c5b260585fcac2383ae6c91aef766 (diff) | |
download | ruby-e41936441bf9fcab9fb4d8ceb70cc73d2a38c9c0.tar.gz |
Surpress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_math.rb | 16 |
2 files changed, 9 insertions, 12 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index a9dae35274..9d21588a95 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -355,6 +355,7 @@ class TestBigDecimal < Test::Unit::TestCase a, b = BigDecimal.new("1").coerce(1.0) assert_instance_of(Float, a) assert_instance_of(Float, b) + assert_equal(2, 1 + BigDecimal.new("1"), '[ruby-core:25697]') end def test_uplus @@ -703,8 +704,4 @@ class TestBigDecimal < Test::Unit::TestCase assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, BigDecimal.new("1E-1" + "0" * 10000).sign) assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, BigDecimal.new("-1E-1" + "0" * 10000).sign) end - - def test_coerce - assert_equal(2, 1 + BigDecimal.new("1"), '[ruby-core:25697]') - end end diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index 15a9b83c35..64b72ce5c0 100644 --- a/test/ruby/test_math.rb +++ b/test/ruby/test_math.rb @@ -114,8 +114,8 @@ class TestMath < Test::Unit::TestCase check(0, Math.atanh(Math.sinh(0) / Math.cosh(0))) check(1, Math.atanh(Math.sinh(1) / Math.cosh(1))) check(2, Math.atanh(Math.sinh(2) / Math.cosh(2))) - assert_nothing_raised { assert_infinity Math.atanh(1) } - assert_nothing_raised { assert_infinity -Math.atanh(-1) } + assert_nothing_raised { assert_infinity(Math.atanh(1)) } + assert_nothing_raised { assert_infinity(-Math.atanh(-1)) } assert_raise(Math::DomainError) { Math.atanh(+1.0 + Float::EPSILON) } assert_raise(Math::DomainError) { Math.atanh(-1.0 - Float::EPSILON) } end @@ -134,8 +134,8 @@ class TestMath < Test::Unit::TestCase check(1, Math.log(10, 10)) check(2, Math.log(100, 10)) assert_equal(1.0/0, Math.log(1.0/0)) - assert_nothing_raised { assert_infinity -Math.log(+0.0) } - assert_nothing_raised { assert_infinity -Math.log(-0.0) } + assert_nothing_raised { assert_infinity(-Math.log(+0.0)) } + assert_nothing_raised { assert_infinity(-Math.log(-0.0)) } assert_raise(Math::DomainError) { Math.log(-1.0) } assert_raise(TypeError) { Math.log(1,nil) } end @@ -145,8 +145,8 @@ class TestMath < Test::Unit::TestCase check(1, Math.log2(2)) check(2, Math.log2(4)) assert_equal(1.0/0, Math.log2(1.0/0)) - assert_nothing_raised { assert_infinity -Math.log2(+0.0) } - assert_nothing_raised { assert_infinity -Math.log2(-0.0) } + assert_nothing_raised { assert_infinity(-Math.log2(+0.0)) } + assert_nothing_raised { assert_infinity(-Math.log2(-0.0)) } assert_raise(Math::DomainError) { Math.log2(-1.0) } end @@ -155,8 +155,8 @@ class TestMath < Test::Unit::TestCase check(1, Math.log10(10)) check(2, Math.log10(100)) assert_equal(1.0/0, Math.log10(1.0/0)) - assert_nothing_raised { assert_infinity -Math.log10(+0.0) } - assert_nothing_raised { assert_infinity -Math.log10(-0.0) } + assert_nothing_raised { assert_infinity(-Math.log10(+0.0)) } + assert_nothing_raised { assert_infinity(-Math.log10(-0.0)) } assert_raise(Math::DomainError) { Math.log10(-1.0) } end |