Skip to content

Commit 8fa843c

Browse files
test: do not rely on singular roots
1 parent ac6c3dc commit 8fa843c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/NonlinearSolveHomotopyContinuation/test/allroots.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ alg = HomotopyContinuationJL{true}(; threading = false)
4040

4141
@testset "`HomotopyContinuationFunction`" begin
4242
denominator = function (u, p)
43-
return [u - 0.7]
43+
return [u - 0.7, u - 0.9]
4444
end
4545
polynomialize = function (u, p)
4646
return sin(u)
@@ -59,7 +59,7 @@ alg = HomotopyContinuationJL{true}(; threading = false)
5959
@test sin(sol.u[1][1]) 0.5
6060

6161
@testset "no valid solutions" begin
62-
prob2 = remake(prob; p = [0.7, 0.7])
62+
prob2 = remake(prob; p = [0.7, 0.9])
6363
sol2 = solve(prob2, alg)
6464
@test !sol2.converged
6565
@test length(sol2) == 1

lib/NonlinearSolveHomotopyContinuation/test/single_root.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ alg = HomotopyContinuationJL{false}(; threading = false)
3131

3232
@testset "`HomotopyContinuationFunction`" begin
3333
denominator = function (u, p)
34-
return [u - 0.7]
34+
return [u - 0.7, u - 0.9]
3535
end
3636
polynomialize = function (u, p)
3737
return sin(u)
@@ -49,7 +49,7 @@ alg = HomotopyContinuationJL{false}(; threading = false)
4949
@test sin(sol.u[1])0.5 atol=1e-10
5050

5151
@testset "no valid solutions" begin
52-
prob2 = remake(prob; p = [0.7, 0.7])
52+
prob2 = remake(prob; p = [0.7, 0.9])
5353
sol2 = solve(prob2, alg)
5454
@test sol2.retcode == SciMLBase.ReturnCode.Infeasible
5555
end

0 commit comments

Comments
 (0)