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

Function Test_ensurePrefixed

pkg/cmd/extension/manager_test.go:1481–1505  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1479}
1480
1481func Test_ensurePrefixed(t *testing.T) {
1482 tests := []struct {
1483 name string
1484 input string
1485 expected string
1486 wantErr bool
1487 }{
1488 {
1489 name: "missing gh- prefix",
1490 input: "bad-kitty",
1491 expected: "gh-bad-kitty",
1492 },
1493 {
1494 name: "has gh- prefix",
1495 input: "gh-purrfect",
1496 expected: "gh-purrfect",
1497 },
1498 }
1499
1500 for _, tt := range tests {
1501 t.Run(tt.name, func(t *testing.T) {
1502 require.Equal(t, tt.expected, normalizeExtension(tt.input))
1503 })
1504 }
1505}
1506
1507func fileNames(files []os.DirEntry) []string {
1508 names := make([]string, len(files))

Callers

nothing calls this directly

Calls 3

normalizeExtensionFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected