(t *testing.T)
| 374 | } |
| 375 | |
| 376 | func TestExtractColumns_WithOrderBy(t *testing.T) { |
| 377 | sql := "SELECT name, salary FROM employees ORDER BY salary" |
| 378 | astNode, err := Parse(sql) |
| 379 | if err != nil { |
| 380 | t.Fatalf("Failed to parse SQL: %v", err) |
| 381 | } |
| 382 | |
| 383 | columns := ExtractColumns(astNode) |
| 384 | if !contains(columns, "name") || !contains(columns, "salary") { |
| 385 | t.Errorf("Expected name and salary columns, got: %v", columns) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | func TestExtractColumns_WithHaving(t *testing.T) { |
| 390 | sql := "SELECT department, COUNT(*) as cnt FROM employees GROUP BY department HAVING cnt > 5" |
nothing calls this directly
no test coverage detected