Skip to content

Commit 66c98e1

Browse files
update tests
1 parent 4677bfe commit 66c98e1

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

test/basics.jl

Lines changed: 13 additions & 13 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_core
1+
using SymbolicUtils: Symbolic, Sym, FnType, Term, Add, Mul, Pow, symtype, operation, arguments, issym, isterm, BasicSymbolic, term, _unwrap_internal
22
using SymbolicUtils
33
using ConstructionBase: setproperties
44
using Setfield
@@ -117,11 +117,11 @@ end
117117
@testset "Base methods" begin
118118
@syms w::Complex z::Complex a::Real b::Real x
119119

120-
@test isequal(w + z, Add(Complex, 0, Dict(w=>1, z=>1)))
121-
@test isequal(z + a, Add(Number, 0, Dict(z=>1, a=>1)))
122-
@test isequal(a + b, Add(Real, 0, Dict(a=>1, b=>1)))
123-
@test isequal(a + x, Add(Number, 0, Dict(a=>1, x=>1)))
124-
@test isequal(a + z, Add(Number, 0, Dict(a=>1, z=>1)))
120+
@test isequal(w + z, Add{Complex}(0, Dict(w=>1, z=>1)))
121+
@test isequal(z + a, Add{Number}(0, Dict(z=>1, a=>1)))
122+
@test isequal(a + b, Add{Real}(0, Dict(a=>1, b=>1)))
123+
@test isequal(a + x, Add{Number}(0, Dict(a=>1, x=>1)))
124+
@test isequal(a + z, Add{Number}(0, Dict(a=>1, z=>1)))
125125

126126
foo(w, z, a, b) = 1.0
127127
SymbolicUtils.promote_symtype(::typeof(foo), args...) = Real
@@ -303,8 +303,8 @@ toterm(t) = Term{symtype(t)}(operation(t), arguments(t))
303303
@testset "diffs" begin
304304
@syms a b c
305305
@test isequal(toterm(-1c), Term{Number}(*, [-1, c]))
306-
@test isequal(toterm(-1(a+b)), Term{Number}(+, [-1a, -b]))
307-
@test isequal(toterm((a + b) - (b + c)), Term{Number}(+, [-1c, a]))
306+
@test isequal(toterm(-1(a+b)), Term{Number}(+, [-b, -a]))
307+
@test isequal(toterm((a + b) - (b + c)), Term{Number}(+, [a, -c]))
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_core(a, a1; full=true)
350-
@test isequal_core(a1, a2; full=true)
351-
@test !isequal_core(a1, a3; full=true)
349+
@test !isequal(_unwrap_internal(a), _unwrap_internal(a1))
350+
@test isequal(_unwrap_internal(a1), _unwrap_internal(a2))
351+
@test !isequal(_unwrap_internal(a1), _unwrap_internal(a3))
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_core(res, x; full=true)
440+
@test isequal(_unwrap_internal(res), _unwrap_internal(x))
441441
ex = x + y
442442
res = substitute(ex, Dict(y => 0))
443-
@test SymbolicUtils.isequal_core(res, x; full=true)
443+
@test isequal(_unwrap_internal(res), _unwrap_internal(x))
444444
end

test/order.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ end
5959

6060
@test istotal(ρ(), -1z())
6161

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

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

7171
@testset "Sym vs Term" begin

0 commit comments

Comments
 (0)