Skip to content

Commit 3e8ffd0

Browse files
committed
Add a test for kwarg propagation
1 parent 214fb0f commit 3e8ffd0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/SimpleNonlinearSolve/test/core/rootfind_tests.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,19 @@ end
120120
p = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
121121

122122
@testset "$(nameof(typeof(alg)))" for alg in (SimpleDFSane(), SimpleTrustRegion(),
123-
SimpleHalley(),
124-
SimpleTrustRegion(; nlsolve_update_rule = Val(true)))
123+
SimpleHalley(), SimpleTrustRegion(; nlsolve_update_rule = Val(true)))
125124
sol = benchmark_nlsolve_oop(newton_fails, u0, p; solver = alg)
126125
@test SciMLBase.successful_retcode(sol)
127126
@test all(abs.(newton_fails(sol.u, p)) .< 1e-9)
128127
end
129128
end
130129

130+
@testitem "Kwargs Propagation" setup=[RootfindingTesting] begin
131+
prob = NonlinearProblem(quadratic_f, ones(4), 2.0; maxiters = 2)
132+
sol = solve(prob, SimpleNewtonRaphson())
133+
@test sol.retcode === ReturnCode.MaxIters
134+
end
135+
131136
@testitem "Allocation Checks" setup=[RootfindingTesting] begin
132137
@testset "$(nameof(typeof(alg)))" for alg in (SimpleNewtonRaphson(),
133138
SimpleHalley(), SimpleBroyden(), SimpleKlement(), SimpleLimitedMemoryBroyden(),

0 commit comments

Comments
 (0)