(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func 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 | } |
nothing calls this directly
no test coverage detected