Skip to content

Commit 49d6fef

Browse files
committed
add a test for Dual & Tangent
1 parent bd0dbb7 commit 49d6fef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/projection.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ Base.zero(x::Dual) = Dual(zero(x.value), zero(x.partial))
4141
@testset "Dual" begin # some weird Real subtype that we should basically leave alone
4242
@test ProjectTo(1.0)(Dual(1.0, 2.0)) isa Dual
4343
@test ProjectTo(1.0)(Dual(1, 2)) isa Dual
44+
45+
# real & complex
4446
@test ProjectTo(1.0 + 1im)(Dual(1.0, 2.0)) isa Complex{<:Dual}
4547
@test ProjectTo(1.0 + 1im)(
4648
Complex(Dual(1.0, 2.0), Dual(1.0, 2.0))
4749
) isa Complex{<:Dual}
4850
@test ProjectTo(1.0)(Complex(Dual(1.0, 2.0), Dual(1.0, 2.0))) isa Dual
51+
52+
# Tangent
53+
@test ProjectTo(Dual(1.0, 2.0))(Tangent{Dual}(; value=1.0)) isa Tangent
4954
end
5055

5156
@testset "Base: arrays of numbers" begin

0 commit comments

Comments
 (0)