What steps will reproduce the problem? If possible, provide source code and
stack trace.
def "test"() {
expect:
//gives true:
assert Double.compare(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY) == 0
//fails:
that Double.POSITIVE_INFINITY, closeTo(Double.POSITIVE_INFINITY, 0.1d)
}
What version of Spock and Groovy are you using?
Spock-0.6, Groovy 1.8
Please provide any additional information below. You can also assign
labels.
spock.util.matcher.HamcrestMatchers.closeTo() uses minus to calculate delta,
but Double.compare() compares bits for the same values. So, IMHO the correct
impl would be something like:
if (compare() == 0) { return true; } return isWithinDelta();
Original issue reported on code.google.com by cum...@gmail.com on 1 Aug 2012 at 12:47
Original issue reported on code.google.com by
cum...@gmail.com
on 1 Aug 2012 at 12:47