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

Function TestScopeLabels

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

Source from the content-addressed store, hash-verified

324}
325
326func TestScopeLabels(t *testing.T) {
327 tests := []struct {
328 name string
329 repoName string
330 wantFirst []string
331 wantSecond []string
332 }{
333 {
334 name: "without repo name",
335 repoName: "",
336 wantFirst: []string{"Project", "recommended"},
337 wantSecond: []string{"Global"},
338 },
339 {
340 name: "with repo name",
341 repoName: "monalisa/octocat-skills",
342 wantFirst: []string{"monalisa/octocat-skills", "recommended"},
343 wantSecond: []string{"Global"},
344 },
345 }
346 for _, tt := range tests {
347 t.Run(tt.name, func(t *testing.T) {
348 labels := ScopeLabels(tt.repoName)
349 require.Len(t, labels, 2)
350 for _, s := range tt.wantFirst {
351 assert.Contains(t, labels[0], s)
352 }
353 for _, s := range tt.wantSecond {
354 assert.Contains(t, labels[1], s)
355 }
356 })
357 }
358}

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