Skip to content

Commit f55cc49

Browse files
test: update some tests
1 parent b9d49bd commit f55cc49

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
@@ -298,7 +298,7 @@ toterm(t) = Term{symtype(t)}(operation(t), arguments(t))
298298
@syms a b c
299299
@test isequal(toterm(-1c), Term{Number}(*, [-1, c]))
300300
@test isequal(toterm(-1(a+b)), Term{Number}(+, [-1a, -b]))
301-
@test isequal(toterm((a + b) - (b + c)), Term{Number}(+, [a, -1c]))
301+
@test isequal(toterm((a + b) - (b + c)), Term{Number}(+, [-1c, a]))
302302
end
303303

304304
@testset "hash" begin
@@ -340,9 +340,9 @@ end
340340
a1 = setmetadata(a, Ctx1, "meta_1")
341341
a2 = setmetadata(a, Ctx1, "meta_1")
342342
a3 = setmetadata(a, Ctx2, "meta_2")
343-
@test !isequal_with_metadata(a, a1)
344-
@test isequal_with_metadata(a1, a2)
345-
@test !isequal_with_metadata(a1, a3)
343+
@test !isequal_core(a, a1; full=true)
344+
@test isequal_core(a1, a2; full=true)
345+
@test !isequal_core(a1, a3; full=true)
346346
end
347347

348348
@testset "subtyping" begin
@@ -424,8 +424,8 @@ end
424424
x = setmetadata(x(t), Int, 3)
425425
ex = x * y
426426
res = substitute(ex, Dict(y => 1))
427-
@test SymbolicUtils.isequal_with_metadata(res, x)
427+
@test SymbolicUtils.isequal_core(res, x; full=true)
428428
ex = x + y
429429
res = substitute(ex, Dict(y => 0))
430-
@test SymbolicUtils.isequal_with_metadata(res, x)
430+
@test SymbolicUtils.isequal_core(res, x; full=true)
431431
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]
@@ -108,4 +108,4 @@ end
108108
ex1 = ex * b
109109

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

0 commit comments

Comments
 (0)