Add test case from github docs

This commit is contained in:
Katrina Verey
2023-01-06 19:25:35 -05:00
parent 150134758f
commit 2591303430

View File

@@ -118,7 +118,7 @@ func TestNewRepoSpecFromUrlErrors(t *testing.T) {
},
"mysterious gh: prefix previously supported is no longer handled": {
"gh:org/repo",
"url lacks host",
"url lacks orgRepo",
},
"username unsupported with http": {
"http://git@foo.com/path/to/repo",
@@ -536,6 +536,18 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
GitSuffix: ".git",
},
},
{
name: "complex github ssh url from docs",
input: "ssh://git@ssh.github.com:443/YOUR-USERNAME/YOUR-REPOSITORY.git",
cloneSpec: "ssh://git@ssh.github.com:443/YOUR-USERNAME/YOUR-REPOSITORY.git",
absPath: notCloned.String(),
repoSpec: RepoSpec{
Host: "ssh://git@ssh.github.com:443/",
OrgRepo: "YOUR-USERNAME/YOUR-REPOSITORY",
Path: "",
GitSuffix: ".git",
},
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {