Skip to content

Accept that NaN ≈ NaN in test_approx #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/check_result.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function test_approx(
msg="";
kwargs...,
)
@test_msg msg isapprox(actual, expected; kwargs...)
@test_msg msg isapprox(actual, expected; nans=true, kwargs...)
end

for (T1, T2) in ((AbstractThunk, Any), (AbstractThunk, AbstractThunk), (Any, AbstractThunk))
Expand Down Expand Up @@ -62,7 +62,7 @@ The `kwargs` are passed on to `isapprox`
function _can_pass_early(actual, expected; kwargs...)
actual == expected && return true
try
return isapprox(actual, expected; kwargs...)
return isapprox(actual, expected; nans=true, kwargs...)
catch err
# Might MethodError, might DimensionMismatch, might fail for some other reason
# we don't care, whatever errored it means we can't quit early
Expand Down Expand Up @@ -158,7 +158,7 @@ It matters primarily for types that overload `add!!` such as `InplaceableThunk`s
`acc` is the value that has been accumulated so far.
`val` is a deriviative, being accumulated into `acc`.

`kwargs` are all passed on to isapprox
`kwargs` are all passed on to `isapprox`
"""
function _test_add!!_behaviour(acc, val; kwargs...)
# Note, we don't test that `acc` is actually mutated because it doesn't have to be
Expand Down