Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Add a test for kwarg propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Feb 15, 2024
1 parent b6b948b commit 17f5f61
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/core/rootfind_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,19 @@ end
p = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

@testset "$(nameof(typeof(alg)))" for alg in (SimpleDFSane(), SimpleTrustRegion(),
SimpleHalley(),
SimpleTrustRegion(; nlsolve_update_rule = Val(true)))
SimpleHalley(), SimpleTrustRegion(; nlsolve_update_rule = Val(true)))
sol = benchmark_nlsolve_oop(newton_fails, u0, p; solver = alg)
@test SciMLBase.successful_retcode(sol)
@test all(abs.(newton_fails(sol.u, p)) .< 1e-9)
end
end

@testitem "Kwargs Propagation" setup=[RootfindingTesting] begin
prob = NonlinearProblem(quadratic_f, ones(4), 2.0; maxiters=2)
sol = solve(prob, SimpleNewtonRaphson())
@test sol.retcode === ReturnCode.MaxIters
end

@testitem "Allocation Checks" setup=[RootfindingTesting] begin
@testset "$(nameof(typeof(alg)))" for alg in (SimpleNewtonRaphson(),
SimpleHalley(), SimpleBroyden(), SimpleKlement(), SimpleLimitedMemoryBroyden(),
Expand Down

0 comments on commit 17f5f61

Please sign in to comment.