From ea56a70eb81e8f7a859f854821481f1cfc18083d Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 4 Oct 2009 00:00:18 +0000 Subject: [PATCH] add assertion message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_math.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index c62466d33c..5b49291df0 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