(t *testing.T)
| 161 | } |
| 162 | |
| 163 | func TestExtractProject(t *testing.T) { |
| 164 | tests := []struct { |
| 165 | path string |
| 166 | want string |
| 167 | }{ |
| 168 | {"/api/myproject/store", "myproject"}, |
| 169 | {"/api/123/envelope", "123"}, |
| 170 | {"/", ""}, |
| 171 | {"/api", ""}, |
| 172 | } |
| 173 | |
| 174 | for _, tt := range tests { |
| 175 | t.Run(tt.path, func(t *testing.T) { |
| 176 | if got := extractProject(tt.path); got != tt.want { |
| 177 | t.Errorf("extractProject(%q) = %q, want %q", tt.path, got, tt.want) |
| 178 | } |
| 179 | }) |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | func TestResolveProject(t *testing.T) { |
| 184 | tests := []struct { |
nothing calls this directly
no test coverage detected