-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow special char in repo name
- Loading branch information
1 parent
d2fa103
commit f655632
Showing
2 changed files
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,15 @@ func TestParseReq(t *testing.T) { | |
input: "https://helm.releases.hashicorp.com/[email protected]", | ||
err: errors.New("not of form 'repo/chart@version(:path)' where repo contains no special characters"), | ||
}, | ||
{ | ||
name: "repo-with-special-chars", | ||
input: "with-dashes/[email protected]", | ||
expected: &Requirement{ | ||
Chart: "with-dashes/package", | ||
Version: "1.0.0", | ||
Directory: "", | ||
}, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
|
@@ -68,14 +77,9 @@ func TestAddRepos(t *testing.T) { | |
err = c.AddRepos( | ||
Repo{Name: "foo", URL: "https://foo.com"}, | ||
Repo{Name: "foo2", URL: "https://foo2.com"}, | ||
) | ||
assert.NoError(t, err) | ||
|
||
// Only \w characters are allowed in repo names | ||
err = c.AddRepos( | ||
Repo{Name: "with-dashes", URL: "https://foo.com"}, | ||
) | ||
assert.EqualError(t, err, "1 Repo(s) were skipped. Please check above logs for details") | ||
assert.NoError(t, err) | ||
|
||
err = c.AddRepos( | ||
Repo{Name: "foo", URL: "https://foo.com"}, | ||
|