(t *testing.T)
| 490 | } |
| 491 | |
| 492 | func TestExtractFunctions_NestedFunctions(t *testing.T) { |
| 493 | sql := "SELECT UPPER(TRIM(name)) FROM users" |
| 494 | astNode, err := Parse(sql) |
| 495 | if err != nil { |
| 496 | t.Fatalf("Failed to parse SQL: %v", err) |
| 497 | } |
| 498 | |
| 499 | functions := ExtractFunctions(astNode) |
| 500 | expected := []string{"UPPER", "TRIM"} |
| 501 | if !stringSlicesEqual(functions, expected) { |
| 502 | t.Errorf("Expected functions %v, got %v", expected, functions) |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | func TestExtractFunctions_InWhere(t *testing.T) { |
| 507 | sql := "SELECT name FROM users WHERE UPPER(name) = 'JOHN'" |
nothing calls this directly
no test coverage detected