|
16 | 16 | expr = sin(a + b) * (a + b) |
17 | 17 | sorted_nodes = topological_sort(expr) |
18 | 18 | @test length(sorted_nodes) == 3 |
19 | | - @test isequal(sorted_nodes[1].rhs, a + b) |
| 19 | + @test isequal(sorted_nodes[1].rhs, term(+, a, b)) |
20 | 20 | @test isequal(sin(sorted_nodes[1].lhs), sorted_nodes[2].rhs) |
21 | 21 |
|
22 | 22 | expr = (a + b)^(a + b) |
23 | 23 | sorted_nodes = topological_sort(expr) |
24 | 24 | @test length(sorted_nodes) == 2 |
25 | | - @test isequal(sorted_nodes[1].rhs, a + b) |
| 25 | + @test isequal(sorted_nodes[1].rhs, term(+, a, b)) |
26 | 26 | 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) |
28 | 28 | let_expr = cse(expr) |
29 | 29 | @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)) |
31 | 31 | 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)) |
33 | 33 |
|
34 | 34 | expr = a + b |
35 | 35 | sorted_nodes = topological_sort(expr) |
36 | 36 | @test length(sorted_nodes) == 1 |
37 | | - @test isequal(sorted_nodes[1].rhs, a + b) |
| 37 | + @test isequal(sorted_nodes[1].rhs, term(+, a, b)) |
38 | 38 | let_expr = cse(expr) |
39 | 39 | @test isempty(let_expr.pairs) |
40 | | - @test isequal(let_expr.body, a + b) |
| 40 | + @test isequal(let_expr.body, term(+, a, b)) |
41 | 41 |
|
42 | 42 | expr = a |
43 | 43 | sorted_nodes = topological_sort(expr) |
|
0 commit comments