@@ -18,8 +18,7 @@ All keyword arguments are passed to `isapprox`.
18
18
function check_equal (
19
19
actual:: Union{AbstractArray{<:Number},Number} ,
20
20
expected:: Union{AbstractArray{<:Number},Number} ,
21
- msg= " " ,
22
- ;
21
+ msg= " " ;
23
22
kwargs... ,
24
23
)
25
24
@test_msg msg isapprox (actual, expected; kwargs... )
@@ -74,7 +73,7 @@ function check_equal(actual::AbstractArray, expected::AbstractArray, msg=""; kwa
74
73
if _can_pass_early (actual, expected)
75
74
@test true
76
75
else
77
- @test_msg " $msg : indexes must match" eachindex (actual) == eachindex (expected)
76
+ @test_msg " $msg : indices must match" eachindex (actual) == eachindex (expected)
78
77
for ii in eachindex (actual)
79
78
new_msg = " $msg $(typeof (actual)) [$ii ]"
80
79
check_equal (actual[ii], expected[ii], new_msg; kwargs... )
124
123
check_equal (x, y:: Tangent , msg= " " ; kwargs... ) = check_equal (y, x, msg; kwargs... )
125
124
126
125
# This catches comparisons of Tangents and Tuples/NamedTuple
127
- # and gives an error message complaining about that. the `@test` will definately fail
126
+ # and gives an error message complaining about that. the `@test` will definitely fail
128
127
const LegacyZygoteCompTypes = Union{Tuple,NamedTuple}
129
128
function check_equal (x:: Tangent , y:: LegacyZygoteCompTypes , msg= " " ; kwargs... )
130
129
@test_msg " $msg : for structural differentials use `Tangent`" typeof (x) === typeof (y)
0 commit comments