Better SCP colon-must-be-after-slash test

This commit is contained in:
Katrina Verey
2023-01-10 16:14:54 -05:00
parent c2885642d6
commit 3134e9b0c2

View File

@@ -92,10 +92,6 @@ func TestNewRepoSpecFromUrlErrors(t *testing.T) {
"htxxxtp://github.com/",
"url lacks host",
},
"bad_scp": {
"git@local/path:file/system",
"url lacks repoPath",
},
"no_org_repo": {
"ssh://git.example.com",
"url lacks repoPath",
@@ -588,6 +584,18 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
GitSuffix: ".git",
},
},
{
name: "colon behind slash not scp delimiter",
input: "git@gitlab.com/user:name/YOUR-REPOSITORY.git/path",
cloneSpec: "git@gitlab.com/user:name/YOUR-REPOSITORY.git",
absPath: notCloned.Join("path"),
repoSpec: RepoSpec{
Host: "git@gitlab.com/",
RepoPath: "user:name/YOUR-REPOSITORY",
KustRootPath: "path",
GitSuffix: ".git",
},
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {