Skip to content

Commit be34414

Browse files
Merge pull request #1009 from contradict/fix_sympy_test
Fix sympy test
2 parents fdf3462 + c63229f commit be34414

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/sympy.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ expr = x * p + (x^2 - 1 + y) * (p + 2t)
2121
sexpr = symbolics_to_sympy(expr)
2222
sp = symbolics_to_sympy(p)
2323

24+
@test SymPy.simplify(symbolics_to_sympy(Symbolics.solve_for(expr, p))) == SymPy.simplify(SymPy.solve(sexpr, sp)[1])
25+
2426
symbolics_sol = SymPy.simplify(symbolics_to_sympy(Symbolics.symbolic_linear_solve(expr, p)))
2527
sympy_sols = SymPy.solve(SymPy.expand(sexpr), sp)
2628
@test !isempty(sympy_sols) && isequal(symbolics_sol, sympy_sols[1])
@@ -73,4 +75,4 @@ sol_vars = Symbolics.get_variables(sol_ode)
7375
const_sym = only(filter(v -> startswith(string(Symbolics.nameof(v)), "C"), sol_vars))
7476
expected_sol = C1 * exp(2 * x)
7577
canonical_sol_ode = Symbolics.substitute(sol_ode, Dict(const_sym => C1))
76-
@test isequal(canonical_sol_ode, expected_sol)
78+
@test isequal(canonical_sol_ode, expected_sol)

0 commit comments

Comments
 (0)