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

Function Test_ensurePrefixed

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

Source from the content-addressed store, hash-verified

1403}
1404
1405func Test_ensurePrefixed(t *testing.T) {
1406 tests := []struct {
1407 name string
1408 input string
1409 expected string
1410 wantErr bool
1411 }{
1412 {
1413 name: "missing gh- prefix",
1414 input: "bad-kitty",
1415 expected: "gh-bad-kitty",
1416 },
1417 {
1418 name: "has gh- prefix",
1419 input: "gh-purrfect",
1420 expected: "gh-purrfect",
1421 },
1422 }
1423
1424 for _, tt := range tests {
1425 t.Run(tt.name, func(t *testing.T) {
1426 require.Equal(t, tt.expected, normalizeExtension(tt.input))
1427 })
1428 }
1429}
1430
1431func fileNames(files []os.DirEntry) []string {
1432 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