Skip to content

Commit bdb8832

Browse files
test: refactor tests as per new CSE changes
1 parent 584c47c commit bdb8832

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/cse.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ end
1616
expr = sin(a + b) * (a + b)
1717
sorted_nodes = topological_sort(expr)
1818
@test length(sorted_nodes) == 3
19-
@test isequal(sorted_nodes[1].rhs, a + b)
19+
@test isequal(sorted_nodes[1].rhs, term(+, a, b))
2020
@test isequal(sin(sorted_nodes[1].lhs), sorted_nodes[2].rhs)
2121

2222
expr = (a + b)^(a + b)
2323
sorted_nodes = topological_sort(expr)
2424
@test length(sorted_nodes) == 2
25-
@test isequal(sorted_nodes[1].rhs, a + b)
25+
@test isequal(sorted_nodes[1].rhs, term(+, a, b))
2626
ab_node = sorted_nodes[1].lhs
27-
@test isequal(ab_node^ab_node, sorted_nodes[2].rhs)
27+
@test isequal(term(^, ab_node, ab_node), sorted_nodes[2].rhs)
2828
let_expr = cse(expr)
2929
@test length(let_expr.pairs) == 1
30-
@test isequal(let_expr.pairs[1].rhs, a + b)
30+
@test isequal(let_expr.pairs[1].rhs, term(+, a, b))
3131
corresponding_sym = let_expr.pairs[1].lhs
32-
@test isequal(let_expr.body, corresponding_sym^corresponding_sym)
32+
@test isequal(let_expr.body, term(^, corresponding_sym, corresponding_sym))
3333

3434
expr = a + b
3535
sorted_nodes = topological_sort(expr)
3636
@test length(sorted_nodes) == 1
37-
@test isequal(sorted_nodes[1].rhs, a + b)
37+
@test isequal(sorted_nodes[1].rhs, term(+, a, b))
3838
let_expr = cse(expr)
3939
@test isempty(let_expr.pairs)
40-
@test isequal(let_expr.body, a + b)
40+
@test isequal(let_expr.body, term(+, a, b))
4141

4242
expr = a
4343
sorted_nodes = topological_sort(expr)

0 commit comments

Comments
 (0)