MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestGetSQLFunctionSignature

Function TestGetSQLFunctionSignature

pkg/lsp/handler_test.go:647–674  ·  view source on GitHub ↗

TestGetSQLFunctionSignature tests function signature lookup

(t *testing.T)

Source from the content-addressed store, hash-verified

645
646// TestGetSQLFunctionSignature tests function signature lookup
647func 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}

Callers

nothing calls this directly

Calls 4

getSQLFunctionSignatureFunction · 0.85
RunMethod · 0.80
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected