(t *testing.T)
| 449 | } |
| 450 | |
| 451 | func TestExtractFunctions_SimpleFunction(t *testing.T) { |
| 452 | sql := "SELECT COUNT(*) FROM users" |
| 453 | astNode, err := Parse(sql) |
| 454 | if err != nil { |
| 455 | t.Fatalf("Failed to parse SQL: %v", err) |
| 456 | } |
| 457 | |
| 458 | functions := ExtractFunctions(astNode) |
| 459 | if len(functions) != 1 || !contains(functions, "COUNT") { |
| 460 | t.Errorf("Expected 'COUNT' function, got: %v", functions) |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | func TestExtractFunctions_MultipleFunctions(t *testing.T) { |
| 465 | sql := "SELECT COUNT(*), AVG(salary), MAX(age), MIN(created_at) FROM users" |
nothing calls this directly
no test coverage detected