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

Function TestRepoNameFromRemote

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

Source from the content-addressed store, hash-verified

287}
288
289func TestRepoNameFromRemote(t *testing.T) {
290 tests := []struct {
291 remote string
292 want string
293 }{
294 {"https://github.com/monalisa/octocat-skills.git", "monalisa/octocat-skills"},
295 {"https://github.com/monalisa/octocat-skills", "monalisa/octocat-skills"},
296 {"git@github.com:monalisa/octocat-skills.git", "monalisa/octocat-skills"},
297 {"git@github.com:monalisa/octocat-skills", "monalisa/octocat-skills"},
298 {"ssh://git@github.com/monalisa/octocat-skills.git", "monalisa/octocat-skills"},
299 {"ssh://git@github.com/monalisa/octocat-skills", "monalisa/octocat-skills"},
300 {"not-a-url", ""},
301 {"", ""},
302 }
303 for _, tt := range tests {
304 t.Run(tt.remote, func(t *testing.T) {
305 assert.Equal(t, tt.want, RepoNameFromRemote(tt.remote))
306 })
307 }
308}
309
310func TestUniqueProjectDirs(t *testing.T) {
311 dirs := UniqueProjectDirs()

Callers

nothing calls this directly

Calls 3

RepoNameFromRemoteFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected