MCPcopy Index your code
hub / github.com/cli/cli / TestScopeLabels

Function TestScopeLabels

internal/skills/registry/registry_test.go:210–242  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

208}
209
210func TestScopeLabels(t *testing.T) {
211 tests := []struct {
212 name string
213 repoName string
214 wantFirst []string
215 wantSecond []string
216 }{
217 {
218 name: "without repo name",
219 repoName: "",
220 wantFirst: []string{"Project", "recommended"},
221 wantSecond: []string{"Global"},
222 },
223 {
224 name: "with repo name",
225 repoName: "monalisa/octocat-skills",
226 wantFirst: []string{"monalisa/octocat-skills", "recommended"},
227 wantSecond: []string{"Global"},
228 },
229 }
230 for _, tt := range tests {
231 t.Run(tt.name, func(t *testing.T) {
232 labels := ScopeLabels(tt.repoName)
233 require.Len(t, labels, 2)
234 for _, s := range tt.wantFirst {
235 assert.Contains(t, labels[0], s)
236 }
237 for _, s := range tt.wantSecond {
238 assert.Contains(t, labels[1], s)
239 }
240 })
241 }
242}

Callers

nothing calls this directly

Calls 4

ScopeLabelsFunction · 0.85
ContainsMethod · 0.80
RunMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected