mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_math.rb: use Float#infinite?
* test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite? returns true also for NaN, so use Float#infinite? instead. [ruby-core:65117] [Feature #10261] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8b9afe6520
commit
5cd2d58396
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Fri Sep 19 10:47:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite?
|
||||
returns true also for NaN, so use Float#infinite? instead.
|
||||
[ruby-core:65117] [Feature #10261]
|
||||
|
||||
Fri Sep 19 05:36:16 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* NEWS: note --with-jemalloc option [ci skip]
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'test/unit'
|
|||
class TestMath < Test::Unit::TestCase
|
||||
def assert_infinity(a, *rest)
|
||||
rest = ["not infinity: #{a.inspect}"] if rest.empty?
|
||||
assert_not_predicate(a, :finite?, *rest)
|
||||
assert_predicate(a, :infinite?, *rest)
|
||||
end
|
||||
|
||||
def assert_nan(a, *rest)
|
||||
|
|
Loading…
Add table
Reference in a new issue