summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-04 00:00:18 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-04 00:00:18 +0000
commitb416167fc8166935df3213c79cb3fae65df13ff0 (patch)
treed2b1511159206e9eb4c3e87bc702736bb85a355a /test
parent5a1b2fb750ea0a16461c17fac446a703be2137b4 (diff)
downloadruby-b416167fc8166935df3213c79cb3fae65df13ff0.tar.gz
ruby-b416167fc8166935df3213c79cb3fae65df13ff0.tar.xz
ruby-b416167fc8166935df3213c79cb3fae65df13ff0.zip
add assertion message.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_math.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb
index c62466d33..5b49291df 100644
--- a/test/ruby/test_math.rb
+++ b/test/ruby/test_math.rb
@@ -2,6 +2,7 @@ require 'test/unit'
class TestMath < Test::Unit::TestCase
def assert_infinity(a, *rest)
+ rest = ["not infinity"] if rest.empty?
assert(!a.finite?, *rest)
end
@@ -197,8 +198,8 @@ class TestMath < Test::Unit::TestCase
# no SEGV [ruby-core:25257]
31.upto(65) do |i|
i = 1 << i
- assert_infinity(Math.gamma(i))
- assert_infinity(Math.gamma(i-1))
+ assert_infinity(Math.gamma(i), "Math.gamma(#{i}) should be INF")
+ assert_infinity(Math.gamma(i-1), "Math.gamma(#{i-1}) should be INF")
end
end