From 950bf01a060e8871cc0d6a5a7b961a74d5c7e565 Mon Sep 17 00:00:00 2001 From: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Date: Sat, 19 Mar 2022 18:34:59 -0500 Subject: [PATCH] tests --- test/DualTest.jl | 7 ++++--- test/runtests.jl | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/DualTest.jl b/test/DualTest.jl index 9bfe6935..297351fe 100644 --- a/test/DualTest.jl +++ b/test/DualTest.jl @@ -27,7 +27,7 @@ dual_isapprox(a::Dual{T,T1,T2}, b::Dual{T3,T4,T5}) where {T,T1,T2,T3,T4,T5} = er ForwardDiff.:≺(::Type{TestTag()}, ::Int) = true ForwardDiff.:≺(::Int, ::Type{TestTag()}) = false -@testset "Dual{TestTag(),$V,$N} and Dual{TestTag(),Dual{TestTag(),$V,$M},$N}" for N in (0,3), M in (0,4), V in (Int, Float32) +@testset "Dual{Z,$V,$N} and Dual{Z,Dual{Z,$V,$M},$N}" for N in (0,3), M in (0,4), V in (Int, Float32) println(" ...testing Dual{TestTag(),$V,$N} and Dual{TestTag(),Dual{TestTag(),$V,$M},$N}") PARTIALS = Partials{N,V}(ntuple(n -> intrand(V), N)) @@ -218,9 +218,10 @@ ForwardDiff.:≺(::Int, ::Type{TestTag()}) = false # M is the length of M_PARTIALS, which affects: # NESTED_FDNUM = Dual{TestTag()}(Dual{TestTag()}(PRIMAL, M_PARTIALS), NESTED_PARTIALS) -@show N M + @show N M NESTED_FDNUM PRIMAL M_PARTIALS2 NESTED_PARTIALS2 @test isequal(NESTED_FDNUM, Dual{TestTag()}(Dual{TestTag()}(PRIMAL, M_PARTIALS2), NESTED_PARTIALS2)) == (N == M == 0) - @test isequal(NESTED_FDNUM, NESTED_FDNUM2) == isequal(PRIMAL, PRIMAL2) && (N == M == 0) + @show N M NESTED_FDNUM NESTED_FDNUM2 PRIMAL PRIMAL2 + @test isequal(NESTED_FDNUM, NESTED_FDNUM2) == isequal(PRIMAL, PRIMAL2) @test (FDNUM == Dual{TestTag()}(PRIMAL, PARTIALS2)) == (N == 0) @test (PRIMAL == PRIMAL2) == (FDNUM == FDNUM2) diff --git a/test/runtests.jl b/test/runtests.jl index 38ef3d4c..d00acfb2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,6 @@ using ForwardDiff, Test -@testset "ForwardDiff" begin +@testset "ForwardDiff.jl" begin t0 = time() @testset "Partials" begin println("##### Testing Partials...")