Skip to content

Commit

Permalink
add test for #551
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Nov 9, 2021
1 parent 61bdc24 commit adf5c79
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/HessianTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,11 @@ for T in (StaticArrays.SArray, StaticArrays.MArray)
@test DiffResults.hessian(sresult3) == DiffResults.hessian(result)
end

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

end # module

0 comments on commit adf5c79

Please sign in to comment.