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

Function TestRepoNameFromRemote

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

Source from the content-addressed store, hash-verified

171}
172
173func TestRepoNameFromRemote(t *testing.T) {
174 tests := []struct {
175 remote string
176 want string
177 }{
178 {"https://github.com/monalisa/octocat-skills.git", "monalisa/octocat-skills"},
179 {"https://github.com/monalisa/octocat-skills", "monalisa/octocat-skills"},
180 {"git@github.com:monalisa/octocat-skills.git", "monalisa/octocat-skills"},
181 {"git@github.com:monalisa/octocat-skills", "monalisa/octocat-skills"},
182 {"ssh://git@github.com/monalisa/octocat-skills.git", "monalisa/octocat-skills"},
183 {"ssh://git@github.com/monalisa/octocat-skills", "monalisa/octocat-skills"},
184 {"not-a-url", ""},
185 {"", ""},
186 }
187 for _, tt := range tests {
188 t.Run(tt.remote, func(t *testing.T) {
189 assert.Equal(t, tt.want, RepoNameFromRemote(tt.remote))
190 })
191 }
192}
193
194func TestUniqueProjectDirs(t *testing.T) {
195 dirs := UniqueProjectDirs()

Callers

nothing calls this directly

Calls 3

RepoNameFromRemoteFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected