Skip to content

Commit 62417f4

Browse files
test: add tests for new keywords of ia_solve
1 parent c728080 commit 62417f4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/solver.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,22 @@ end
471471

472472
@test all(lhs .≈ rhs)
473473
@test all(lhs_solve .≈ rhs)
474+
475+
@testset "Keyword arguments" begin
476+
expr = sec(x ^ 2 + 4x + 4) ^ 3 - 3
477+
roots = ia_solve(expr, x)
478+
@test length(roots) == 6 # 2 quadratic roots * 3 roots from cbrt(3)
479+
roots = ia_solve(expr, x; complex_roots = false)
480+
@test length(roots) == 2
481+
# the `n` in `θ + n * 2π`
482+
@test length(Symbolics.get_variables(roots[1])) == 1
483+
@test length(Symbolics.get_variables(roots[2])) == 1
484+
roots = ia_solve(expr, x; complex_roots = false, periodic_roots = false)
485+
@test length(roots) == 2
486+
@test length(Symbolics.get_variables(roots[1])) == 0
487+
@test length(Symbolics.get_variables(roots[2])) ==0
488+
@test_nowarn eval.(Symbolics.toexpr.(roots))
489+
end
474490
end
475491

476492
@testset "Sqrt case poly" begin

0 commit comments

Comments
 (0)