Test simple expression counting visitor
()
| 211 | |
| 212 | |
| 213 | def test_simple_expr_counter(): |
| 214 | """Test simple expression counting visitor""" |
| 215 | x = Var("x", dtype="int32") |
| 216 | y = Var("y", dtype="int32") |
| 217 | |
| 218 | # Create simple expression: x + y |
| 219 | expr = Add(x, y) |
| 220 | |
| 221 | counter = SimpleExprCounter() |
| 222 | counter.visit_expr(expr) |
| 223 | |
| 224 | assert counter.var_count == 2 # x and y |
| 225 | assert counter.add_count == 1 # one add |
| 226 | |
| 227 | |
| 228 | def test_variable_replacer(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…