Skip to content

Commit adf5c79

Browse files
committed
add test for #551
1 parent 61bdc24 commit adf5c79

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/HessianTest.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,11 @@ for T in (StaticArrays.SArray, StaticArrays.MArray)
157157
@test DiffResults.hessian(sresult3) == DiffResults.hessian(result)
158158
end
159159

160+
@testset "branches in dot" begin
161+
# https://github.com/JuliaDiff/ForwardDiff.jl/issues/551
162+
H = [1 2 3; 4 5 6; 7 8 9];
163+
@test ForwardDiff.hessian(x->dot(x,H,x), fill(0.00001, 3)) [2 6 10; 6 10 14; 10 14 18]
164+
@test ForwardDiff.hessian(x->dot(x,H,x), zeros(3)) [2 6 10; 6 10 14; 10 14 18]
165+
end
166+
160167
end # module

0 commit comments

Comments
 (0)