(t *testing.T)
| 476 | } |
| 477 | |
| 478 | func TestExtractFunctions_StringFunctions(t *testing.T) { |
| 479 | sql := "SELECT UPPER(name), LOWER(email), SUBSTRING(address, 1, 10) FROM users" |
| 480 | astNode, err := Parse(sql) |
| 481 | if err != nil { |
| 482 | t.Fatalf("Failed to parse SQL: %v", err) |
| 483 | } |
| 484 | |
| 485 | functions := ExtractFunctions(astNode) |
| 486 | expected := []string{"UPPER", "LOWER", "SUBSTRING"} |
| 487 | if !stringSlicesEqual(functions, expected) { |
| 488 | t.Errorf("Expected functions %v, got %v", expected, functions) |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | func TestExtractFunctions_NestedFunctions(t *testing.T) { |
| 493 | sql := "SELECT UPPER(TRIM(name)) FROM users" |
nothing calls this directly
no test coverage detected