(t *testing.T)
| 168 | } |
| 169 | |
| 170 | func TestWalk_SimpleNodeCounting(t *testing.T) { |
| 171 | sql := `SELECT a FROM table1` |
| 172 | parser := NewParser(sql) |
| 173 | stmts, err := parser.ParseStmts() |
| 174 | require.NoError(t, err) |
| 175 | |
| 176 | var nodeCount int |
| 177 | Walk(stmts[0], func(node Expr) bool { |
| 178 | nodeCount++ |
| 179 | return true |
| 180 | }) |
| 181 | |
| 182 | require.Greater(t, nodeCount, 0, "Walk should visit nodes") |
| 183 | require.Greater(t, nodeCount, 3, "Should visit at least SELECT, column, table nodes") |
| 184 | } |
| 185 | |
| 186 | func TestFind_NoMatch(t *testing.T) { |
| 187 | sql := `SELECT a FROM table1` |
nothing calls this directly
no test coverage detected
searching dependent graphs…