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

Function TestScopeLabels

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

Source from the content-addressed store, hash-verified

261}
262
263func TestScopeLabels(t *testing.T) {
264 tests := []struct {
265 name string
266 repoName string
267 wantFirst []string
268 wantSecond []string
269 }{
270 {
271 name: "without repo name",
272 repoName: "",
273 wantFirst: []string{"Project", "recommended"},
274 wantSecond: []string{"Global"},
275 },
276 {
277 name: "with repo name",
278 repoName: "monalisa/octocat-skills",
279 wantFirst: []string{"monalisa/octocat-skills", "recommended"},
280 wantSecond: []string{"Global"},
281 },
282 }
283 for _, tt := range tests {
284 t.Run(tt.name, func(t *testing.T) {
285 labels := ScopeLabels(tt.repoName)
286 require.Len(t, labels, 2)
287 for _, s := range tt.wantFirst {
288 assert.Contains(t, labels[0], s)
289 }
290 for _, s := range tt.wantSecond {
291 assert.Contains(t, labels[1], s)
292 }
293 })
294 }
295}

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