Skip to content

Commit f8fd1da

Browse files
test: update some tests
1 parent 5cec229 commit f8fd1da

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

test/basics.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using SymbolicUtils: Symbolic, Sym, FnType, Term, Add, Mul, Pow, symtype, operation, arguments, issym, isterm, BasicSymbolic, term, isequal_with_metadata
1+
using SymbolicUtils: Symbolic, Sym, FnType, Term, Add, Mul, Pow, symtype, operation, arguments, issym, isterm, BasicSymbolic, term, isequal_core
22
using SymbolicUtils
33
using ConstructionBase: setproperties
44
using Setfield
@@ -304,7 +304,7 @@ toterm(t) = Term{symtype(t)}(operation(t), arguments(t))
304304
@syms a b c
305305
@test isequal(toterm(-1c), Term{Number}(*, [-1, c]))
306306
@test isequal(toterm(-1(a+b)), Term{Number}(+, [-1a, -b]))
307-
@test isequal(toterm((a + b) - (b + c)), Term{Number}(+, [a, -1c]))
307+
@test isequal(toterm((a + b) - (b + c)), Term{Number}(+, [-1c, a]))
308308
end
309309

310310
@testset "hash" begin
@@ -346,9 +346,9 @@ end
346346
a1 = setmetadata(a, Ctx1, "meta_1")
347347
a2 = setmetadata(a, Ctx1, "meta_1")
348348
a3 = setmetadata(a, Ctx2, "meta_2")
349-
@test !isequal_with_metadata(a, a1)
350-
@test isequal_with_metadata(a1, a2)
351-
@test !isequal_with_metadata(a1, a3)
349+
@test !isequal_core(a, a1; full=true)
350+
@test isequal_core(a1, a2; full=true)
351+
@test !isequal_core(a1, a3; full=true)
352352
end
353353

354354
@testset "subtyping" begin
@@ -437,8 +437,8 @@ end
437437
x = setmetadata(x(t), Int, 3)
438438
ex = x * y
439439
res = substitute(ex, Dict(y => 1))
440-
@test SymbolicUtils.isequal_with_metadata(res, x)
440+
@test SymbolicUtils.isequal_core(res, x; full=true)
441441
ex = x + y
442442
res = substitute(ex, Dict(y => 0))
443-
@test SymbolicUtils.isequal_with_metadata(res, x)
443+
@test SymbolicUtils.isequal_core(res, x; full=true)
444444
end

test/order.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ end
6060
@test istotal(ρ(), -1z())
6161

6262
@syms a(t) b(t) t
63-
@test a(t) <b(t)
64-
@test !(b(t) <a(t))
63+
@test b(t) <a(t)
64+
@test !(a(t) <b(t))
6565

6666
@syms y() x()
67-
@test x() <y()
68-
@test !(y() <x())
67+
@test y() <x()
68+
@test !(x() <y())
6969
end
7070

7171
@testset "Sym vs Term" begin

test/rewrite.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ end
3838
@test @rule((~x)^(~x) => ~x)(b^a) === nothing
3939
@test @rule((~x)^(~x) => ~x)(a+a) === nothing
4040
@eqtest @rule((~x)^(~x) => ~x)(sin(a)^sin(a)) == sin(a)
41-
@eqtest @rule((~x*~y + ~x*~z) => ~x * (~y+~z))(a*b + a*c) == a*(b+c)
41+
@eqtest @rule((~x*~y + ~z*~x) => ~x * (~y+~z))(a*b + a*c) == a*(b+c)
4242

4343
@eqtest @rule(+(~~x) => ~~x)(a + b) == [a,b]
4444
@eqtest @rule(+(~~x) => ~~x)(term(+, a, b, c)) == [a,b,c]
@@ -143,4 +143,4 @@ end
143143
ex1 = ex * b
144144

145145
@test getmetadata(arguments(ex1)[1], MetaData) == :metadata
146-
end
146+
end

0 commit comments

Comments
 (0)