[ruby-core:65120] [ruby-trunk - Feature #10261] [Closed] [PATCH] Fix improper test method

From: nobu@...
Date: 2014-09-19 01:47:19 UTC
List: ruby-core #65120
Issue #10261 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r47635.

----------
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]

----------------------------------------
Feature #10261: [PATCH] Fix improper test method
https://bugs.ruby-lang.org/issues/10261#change-48972

* Author: gogo tanaka
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: test
* Target version: current: 2.2.0
----------------------------------------
Right now, a test method `TestMath#assert_infinity` implement like below,

```
def assert_infinity(a, *rest)
  rest = ["not infinity: #{a.inspect}"] if rest.empty?
  assert_not_predicate(a, :finite?, *rest)
end
```

I suppose this is intended to check Float::INFINITY or not, 

but Float#finite returns True if the value is not NaN or 賊Float::INFINITY.

So I fixed it to check Float::INFINITY or not.

If you have  different aim for that, please feel free to tell me.

Thank you. gogo.



---Files--------------------------------
test_math_ Fix improper test method.PATCH (443 Bytes)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next