Skip to content

Commit a693f29

Browse files
authored
Merge pull request #733 from SciML/myb/latex
Re-enable latexify tests
2 parents 135821e + bb83116 commit a693f29

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RuntimeGeneratedFunctions = "0.4, 0.5"
5252
SafeTestsets = "0.0.1"
5353
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0"
5454
StaticArrays = "0.10, 0.11, 0.12, 1.0"
55-
SymbolicUtils = "0.7"
55+
SymbolicUtils = "0.7.3"
5656
TreeViews = "0.3"
5757
UnPack = "0.1, 1.0"
5858
Unitful = "1.1"

test/direct.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ eqs = [σ*(y-x),
1313
x*y - β*z]
1414

1515

16-
simpexpr = Expr[:($(*)(σ, $(+)($(*)(-1, x), y))),
17-
:($(+)($(*)(x, $(+)($(*)(-1, z), ρ)), $(*)(-1, y))),
18-
:($(+)($(*)(x, y), $(*)(-1, z, β)))]
16+
simpexpr = [
17+
:($(*)(σ, $(+)(y, $(*)(-1, x))))
18+
:($(+)($(*)(x, $(+)(ρ, $(*)(-1, z))), $(*)(-1, y)))
19+
:($(+)($(*)(x, y), $(*)(-1, z, β)))
20+
]
1921

2022
for i in 1:3
2123
@test ModelingToolkit.toexpr.(eqs)[i] == simpexpr[i]

test/latexify.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ eqs = [D(x) ~ σ*(y-x)*D(x-y)/D(z),
3030
# Latexify.@generate_test latexify(eqs)
3131
@test latexify(eqs) == replace(
3232
raw"\begin{align}
33-
\frac{dx(t)}{dt} =& \left( y\left( t \right) -1 x\left( t \right) \right) \left( \frac{dz(t)}{dt} \right)^{-1} \sigma \frac{d\left(x\left( t \right) -1 \cdot y\left( t \right)\right)}{dt} \\
34-
0 =& -1 y\left( t \right) + 0.1 x\left( t \right) \sigma \left( -1 z\left( t \right) + \rho \right) \\
35-
\frac{dz(t)}{dt} =& x\left( t \right) \left( y\left( t \right) \right)^{\frac{2}{3}} -1 z\left( t \right) \beta
33+
\frac{dx(t)}{dt} =& \sigma \frac{d\left(x\left( t \right) -1 \cdot y\left( t \right)\right)}{dt} \left( y\left( t \right) -1 x\left( t \right) \right) \left( \frac{dz(t)}{dt} \right)^{-1} \\
34+
0 =& -1 y\left( t \right) + 0.1 \sigma x\left( t \right) \left( \rho -1 z\left( t \right) \right) \\
35+
\frac{dz(t)}{dt} =& x\left( t \right) \left( y\left( t \right) \right)^{\frac{2}{3}} -1 \beta z\left( t \right)
3636
\end{align}
3737
", "\r\n"=>"\n")
3838

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ using SafeTestsets, Test
3232
@safetestset "Variable Utils Test" begin include("variable_utils.jl") end
3333
println("Last test requires gcc available in the path!")
3434
@safetestset "C Compilation Test" begin include("ccompile.jl") end
35-
#@safetestset "Latexify recipes Test" begin include("latexify.jl") end
35+
@safetestset "Latexify recipes Test" begin include("latexify.jl") end

test/variable_utils.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using ModelingToolkit, Test
2+
using SymbolicUtils: <
23
@parameters α β δ
34
expr = (((1 / β - 1) + δ) / α) ^ (1 /- 1))
4-
ref = [β, δ, α]
5-
sol = Num.(ModelingToolkit.get_variables(expr))
5+
ref = sort([β, δ, α], lt = <ₑ)
6+
sol = sort(Num.(ModelingToolkit.get_variables(expr)), lt = <)
67
@test all(simplify, sol[i] == ref[i] for i in 1:3)
78

89
@parameters γ

0 commit comments

Comments
 (0)