TestGetSQLFunctionSignature tests function signature lookup
(t *testing.T)
| 645 | |
| 646 | // TestGetSQLFunctionSignature tests function signature lookup |
| 647 | func TestGetSQLFunctionSignature(t *testing.T) { |
| 648 | functions := []string{ |
| 649 | "COUNT", "SUM", "AVG", "MIN", "MAX", |
| 650 | "COALESCE", "NULLIF", "CAST", "SUBSTRING", |
| 651 | "TRIM", "UPPER", "LOWER", "LENGTH", "CONCAT", |
| 652 | "ROW_NUMBER", "RANK", "DENSE_RANK", "LAG", "LEAD", |
| 653 | "FIRST_VALUE", "LAST_VALUE", "NTILE", |
| 654 | } |
| 655 | |
| 656 | for _, fn := range functions { |
| 657 | t.Run(fn, func(t *testing.T) { |
| 658 | sig := getSQLFunctionSignature(fn) |
| 659 | if sig == nil { |
| 660 | t.Errorf("expected signature for %s, got nil", fn) |
| 661 | return |
| 662 | } |
| 663 | if sig.Label == "" { |
| 664 | t.Errorf("expected non-empty label for %s", fn) |
| 665 | } |
| 666 | }) |
| 667 | } |
| 668 | |
| 669 | // Test unknown function |
| 670 | sig := getSQLFunctionSignature("UNKNOWN_FUNCTION") |
| 671 | if sig != nil { |
| 672 | t.Error("expected nil for unknown function") |
| 673 | } |
| 674 | } |
nothing calls this directly
no test coverage detected