Skip to content

Commit 9c0c27c

Browse files
committed
Test CSE topological_sort on array of symbolics
1 parent 4426e88 commit 9c0c27c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/cse.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,12 @@ end
4545
let_expr = cse(expr)
4646
@test isempty(let_expr.pairs)
4747
@test isequal(let_expr.body, a)
48+
49+
# array symbolics
50+
# https://github.com/JuliaSymbolics/SymbolicUtils.jl/pull/688#pullrequestreview-2554931739
51+
@syms c
52+
function foo end
53+
ex = term(foo, [a^2 + b^2, b^2 + c], c; type = Real)
54+
sorted_nodes = topological_sort(ex)
55+
@test length(sorted_nodes) == 6
4856
end

0 commit comments

Comments
 (0)