Skip to content

Commit 6320734

Browse files
committed
test maketerm
1 parent 837d4e5 commit 6320734

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/basics.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,20 @@ end
214214
@test_reference "inspect_output/sub14.txt" sprint(io->SymbolicUtils.inspect(io, SymbolicUtils.pluck(ex, 14)))
215215
end
216216

217-
@testset "similarterm" begin
217+
@testset "maketerm" begin
218218
@syms a b c
219-
@test isequal(SymbolicUtils.similarterm((b + c), +, [a, (b+c)]).dict, Dict(a=>1,b=>1,c=>1))
220-
@test isequal(SymbolicUtils.similarterm(b^2, ^, [b^2, 1//2]), b)
219+
@test isequal(SymbolicUtils.maketerm(typeof(b + c), +, [a, (b+c)], Number, nothing).dict, Dict(a=>1,b=>1,c=>1))
220+
@test isequal(SymbolicUtils.maketerm(typeof(b^2), ^, [b^2, 1//2], Number, nothing), b)
221221

222-
# test that similarterm doesn't hard-code BasicSymbolic subtype
222+
# test that maketerm doesn't hard-code BasicSymbolic subtype
223223
# and is consistent with BasicSymbolic arithmetic operations
224-
@test isequal(SymbolicUtils.similarterm(a / b, *, [a / b, c]), (a / b) * c)
225-
@test isequal(SymbolicUtils.similarterm(a * b, *, [0, c]), 0)
226-
@test isequal(SymbolicUtils.similarterm(a^b, ^, [a * b, 3]), (a * b)^3)
224+
@test isequal(SymbolicUtils.maketerm(typeof(a / b), *, [a / b, c], Number, nothing), (a / b) * c)
225+
@test isequal(SymbolicUtils.maketerm(typeof(a * b), *, [0, c], Number, nothing), 0)
226+
@test isequal(SymbolicUtils.maketerm(typeof(a^b), ^, [a * b, 3], Number, nothing), (a * b)^3)
227227

228-
# test that similarterm sets metadata correctly
228+
# test that maketerm sets metadata correctly
229229
metadata = Base.ImmutableDict{DataType, Any}(Ctx1, "meta_1")
230-
s = SymbolicUtils.similarterm(a^b, ^, [a * b, 3]; metadata = metadata)
230+
s = SymbolicUtils.maketerm(typeof(a^b), ^, [a * b, 3], Number, metadata)
231231
@test hasmetadata(s, Ctx1)
232232
@test getmetadata(s, Ctx1) == "meta_1"
233233
end

0 commit comments

Comments
 (0)