diff --git a/test/sparse.jl b/test/sparse.jl index bb1d72ed8..1f4d07161 100644 --- a/test/sparse.jl +++ b/test/sparse.jl @@ -43,11 +43,13 @@ jac_sparsity = Symbolics.jacobian_sparsity((du, u) -> brusselator_2d_loop(du, u, u0) jac_prototype = float.(jac_sparsity) fill!(jac_prototype, 0) +@test all(iszero, jac_prototype) ff = NonlinearFunction(brusselator_2d_loop; jac_prototype) prob_brusselator_2d = NonlinearProblem(ff, u0, p) sol = solve(prob_brusselator_2d, NewtonRaphson()) @test norm(sol.resid) < 1e-8 +@test !all(iszero, jac_prototype) sol = solve(prob_brusselator_2d, NewtonRaphson(autodiff = false)) @test norm(sol.resid) < 1e-6