Skip to content

Commit 447c9e9

Browse files
authored
Accept that NaN ≈ NaN
1 parent 683e023 commit 447c9e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/check_result.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function test_approx(
2121
msg="";
2222
kwargs...,
2323
)
24-
@test_msg msg isapprox(actual, expected; kwargs...)
24+
@test_msg msg isapprox(actual, expected; nans=true, kwargs...)
2525
end
2626

2727
for (T1, T2) in ((AbstractThunk, Any), (AbstractThunk, AbstractThunk), (Any, AbstractThunk))
@@ -62,7 +62,7 @@ The `kwargs` are passed on to `isapprox`
6262
function _can_pass_early(actual, expected; kwargs...)
6363
actual == expected && return true
6464
try
65-
return isapprox(actual, expected; kwargs...)
65+
return isapprox(actual, expected; nans=true, kwargs...)
6666
catch err
6767
# Might MethodError, might DimensionMismatch, might fail for some other reason
6868
# we don't care, whatever errored it means we can't quit early
@@ -158,7 +158,7 @@ It matters primarily for types that overload `add!!` such as `InplaceableThunk`s
158158
`acc` is the value that has been accumulated so far.
159159
`val` is a deriviative, being accumulated into `acc`.
160160
161-
`kwargs` are all passed on to isapprox
161+
`kwargs` are all passed on to `isapprox`
162162
"""
163163
function _test_add!!_behaviour(acc, val; kwargs...)
164164
# Note, we don't test that `acc` is actually mutated because it doesn't have to be

0 commit comments

Comments
 (0)