MCPcopy Create free account
hub / github.com/cli/cli / TestScopeLabels

Function TestScopeLabels

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

Source from the content-addressed store, hash-verified

341}
342
343func TestScopeLabels(t *testing.T) {
344 tests := []struct {
345 name string
346 repoName string
347 wantFirst []string
348 wantSecond []string
349 }{
350 {
351 name: "without repo name",
352 repoName: "",
353 wantFirst: []string{"Project", "recommended"},
354 wantSecond: []string{"Global"},
355 },
356 {
357 name: "with repo name",
358 repoName: "monalisa/octocat-skills",
359 wantFirst: []string{"monalisa/octocat-skills", "recommended"},
360 wantSecond: []string{"Global"},
361 },
362 }
363 for _, tt := range tests {
364 t.Run(tt.name, func(t *testing.T) {
365 labels := ScopeLabels(tt.repoName)
366 require.Len(t, labels, 2)
367 for _, s := range tt.wantFirst {
368 assert.Contains(t, labels[0], s)
369 }
370 for _, s := range tt.wantSecond {
371 assert.Contains(t, labels[1], s)
372 }
373 })
374 }
375}

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