From 447c9e919836e57727929d9e8ea21c924da5cd1b Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Fri, 1 Oct 2021 13:41:06 +0100 Subject: [PATCH] =?UTF-8?q?Accept=20that=20NaN=20=E2=89=88=20NaN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/check_result.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/check_result.jl b/src/check_result.jl index b6b6e0b..54fba7c 100644 --- a/src/check_result.jl +++ b/src/check_result.jl @@ -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)) @@ -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 @@ -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