Test with nested expressions
()
| 398 | |
| 399 | |
| 400 | def test_nested_expressions(): |
| 401 | """Test with nested expressions""" |
| 402 | x = Var("x", dtype="int32") |
| 403 | y = Var("y", dtype="int32") |
| 404 | z = Var("z", dtype="int32") |
| 405 | |
| 406 | # Create nested expression: (x + y) * z |
| 407 | inner_add = Add(x, y) |
| 408 | expr = Mul(inner_add, z) |
| 409 | |
| 410 | counter = SimpleExprCounter() |
| 411 | counter.visit_expr(expr) |
| 412 | |
| 413 | assert counter.var_count == 3 # x, y, z |
| 414 | assert counter.add_count == 1 # one add |
| 415 | assert counter.mul_count == 1 # one mul |
| 416 | |
| 417 | |
| 418 | def test_simple_mutations(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…