|
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 |
2 | 2 | using SymbolicUtils
|
3 | 3 | using ConstructionBase: setproperties
|
4 | 4 | using Setfield
|
@@ -117,11 +117,11 @@ end
|
117 | 117 | @testset "Base methods" begin
|
118 | 118 | @syms w::Complex z::Complex a::Real b::Real x
|
119 | 119 |
|
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))) |
125 | 125 |
|
126 | 126 | foo(w, z, a, b) = 1.0
|
127 | 127 | SymbolicUtils.promote_symtype(::typeof(foo), args...) = Real
|
@@ -303,8 +303,8 @@ toterm(t) = Term{symtype(t)}(operation(t), arguments(t))
|
303 | 303 | @testset "diffs" begin
|
304 | 304 | @syms a b c
|
305 | 305 | @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])) |
308 | 308 | end
|
309 | 309 |
|
310 | 310 | @testset "hash" begin
|
|
346 | 346 | a1 = setmetadata(a, Ctx1, "meta_1")
|
347 | 347 | a2 = setmetadata(a, Ctx1, "meta_1")
|
348 | 348 | 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)) |
352 | 352 | end
|
353 | 353 |
|
354 | 354 | @testset "subtyping" begin
|
|
437 | 437 | x = setmetadata(x(t), Int, 3)
|
438 | 438 | ex = x * y
|
439 | 439 | res = substitute(ex, Dict(y => 1))
|
440 |
| - @test SymbolicUtils.isequal_core(res, x; full=true) |
| 440 | + @test isequal(_unwrap_internal(res), _unwrap_internal(x)) |
441 | 441 | ex = x + y
|
442 | 442 | res = substitute(ex, Dict(y => 0))
|
443 |
| - @test SymbolicUtils.isequal_core(res, x; full=true) |
| 443 | + @test isequal(_unwrap_internal(res), _unwrap_internal(x)) |
444 | 444 | end
|
0 commit comments