Skip to content

Commit e4e4cf5

Browse files
shashiYingboMa
andcommitted
update the namespaced exprs tests
Co-authored-by: "Yingbo Ma" <[email protected]>
1 parent 0af2fe9 commit e4e4cf5

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

test/direct.jl

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

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

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

test/simplify.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ simplify(minus_op)
1919

2020
@variables x
2121

22-
@test toexpr(expand_derivatives(Differential(x)((x-2)^2))) == :(2 * (-2 + x))
23-
@test toexpr(expand_derivatives(Differential(x)((x-2)^3))) == :(3 * (-2 + x)^2)
24-
@test toexpr(simplify(x+2+3)) == :(5 + x)
22+
@test toexpr(expand_derivatives(Differential(x)((x-2)^2))) == :($(*)(2, $(+)(-2, x)))
23+
@test toexpr(expand_derivatives(Differential(x)((x-2)^3))) == :($(*)(3, $(^)($(+)(-2, x), 2)))
24+
@test toexpr(simplify(x+2+3)) == :($(+)(5, x))
2525

2626
d1 = Differential(x)((-2 + x)^2)
2727
d2 = Differential(x)(d1)

0 commit comments

Comments
 (0)