MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestCatalogFromSearchPath

Function TestCatalogFromSearchPath

server/sqlcore/identifier_test.go:35–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestCatalogFromSearchPath(t *testing.T) {
36 tests := []struct {
37 name string
38 searchPath string
39 want string
40 }{
41 {name: "qualified catalog first", searchPath: "analytics.public,memory.main", want: "analytics"},
42 {name: "quoted qualified catalog first", searchPath: `"analytics"."public", memory.main`, want: "analytics"},
43 {name: "escaped comma inside quoted schema", searchPath: `"analytics"."pub,lic", memory.main`, want: "analytics"},
44 {name: "unqualified first entry", searchPath: "main,memory.main", want: ""},
45 {name: "empty", searchPath: "", want: ""},
46 }
47
48 for _, tt := range tests {
49 t.Run(tt.name, func(t *testing.T) {
50 if got := CatalogFromSearchPath(tt.searchPath); got != tt.want {
51 t.Fatalf("CatalogFromSearchPath(%q) = %q, want %q", tt.searchPath, got, tt.want)
52 }
53 })
54 }
55}

Callers

nothing calls this directly

Calls 2

CatalogFromSearchPathFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected