(t *testing.T)
| 462 | } |
| 463 | |
| 464 | func TestExtractFunctions_MultipleFunctions(t *testing.T) { |
| 465 | sql := "SELECT COUNT(*), AVG(salary), MAX(age), MIN(created_at) FROM users" |
| 466 | astNode, err := Parse(sql) |
| 467 | if err != nil { |
| 468 | t.Fatalf("Failed to parse SQL: %v", err) |
| 469 | } |
| 470 | |
| 471 | functions := ExtractFunctions(astNode) |
| 472 | expected := []string{"COUNT", "AVG", "MAX", "MIN"} |
| 473 | if !stringSlicesEqual(functions, expected) { |
| 474 | t.Errorf("Expected functions %v, got %v", expected, functions) |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | func TestExtractFunctions_StringFunctions(t *testing.T) { |
| 479 | sql := "SELECT UPPER(name), LOWER(email), SUBSTRING(address, 1, 10) FROM users" |
nothing calls this directly
no test coverage detected