mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add assertion message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
31959b52ef
commit
ea56a70eb8
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ require 'test/unit'
|
||||||
|
|
||||||
class TestMath < Test::Unit::TestCase
|
class TestMath < Test::Unit::TestCase
|
||||||
def assert_infinity(a, *rest)
|
def assert_infinity(a, *rest)
|
||||||
|
rest = ["not infinity"] if rest.empty?
|
||||||
assert(!a.finite?, *rest)
|
assert(!a.finite?, *rest)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -197,8 +198,8 @@ class TestMath < Test::Unit::TestCase
|
||||||
# no SEGV [ruby-core:25257]
|
# no SEGV [ruby-core:25257]
|
||||||
31.upto(65) do |i|
|
31.upto(65) do |i|
|
||||||
i = 1 << i
|
i = 1 << i
|
||||||
assert_infinity(Math.gamma(i))
|
assert_infinity(Math.gamma(i), "Math.gamma(#{i}) should be INF")
|
||||||
assert_infinity(Math.gamma(i-1))
|
assert_infinity(Math.gamma(i-1), "Math.gamma(#{i-1}) should be INF")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue