Skip to content

Commit

Permalink
fix some complex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed May 31, 2022
1 parent de7d5be commit 5394f97
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/DualTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ ForwardDiff.:≺(::Int, ::Type{TestTag()}) = false
@test abs(NESTED_FDNUM) === NESTED_FDNUM

if V != Int
for (M, f, arity) in DiffRules.diffrules(filter_modules = nothing)
@testset "$f" for (M, f, arity) in DiffRules.diffrules(filter_modules = nothing)
if f in (:/, :rem2pi)
continue # Skip these rules
elseif !(isdefined(@__MODULE__, M) && isdefined(getfield(@__MODULE__, M), f))
Expand Down Expand Up @@ -521,10 +521,14 @@ ForwardDiff.:≺(::Int, ::Type{TestTag()}) = false
else
@test dx isa Complex{<:Dual{TestTag()}}
@test dy isa Complex{<:Dual{TestTag()}}
@test real(value(dx)) == real(actualval)
@test real(value(dy)) == real(actualval)
@test imag(value(dx)) == imag(actualval)
@test imag(value(dy)) == imag(actualval)
# @test real(value(dx)) == real(actualval)
# @test real(value(dy)) == real(actualval)
# @test imag(value(dx)) == imag(actualval)
# @test imag(value(dy)) == imag(actualval)
@test value(real(dx)) == real(actualval)
@test value(real(dy)) == real(actualval)
@test value(imag(dx)) == imag(actualval)
@test value(imag(dy)) == imag(actualval)
@test partials(real(dx), 1) real(actualdx) nans=true
@test partials(real(dy), 1) real(actualdy) nans=true
@test partials(imag(dx), 1) imag(actualdx) nans=true
Expand Down

0 comments on commit 5394f97

Please sign in to comment.