6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 15:39:46 +00:00

Finish refactoring by replacing old pkg with new one

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-28 16:34:44 +02:00
parent ca9be3d98f
commit 1bc3928cf5
14 changed files with 523 additions and 1432 deletions

View File

@@ -51,13 +51,13 @@ func TestURLParse(t *testing.T) {
for _, test := range tests {
url, err := ParseURL(test.in)
if err != nil {
t.Errorf("Error parsing URL: %+v", err)
t.Errorf("Error parsing Path: %+v", err)
}
got := URLToPath(url)
if got != test.want {
t.Errorf("Wrong result of parsing URL: %s, got: %s; want: %s", test.in, got, test.want)
t.Errorf("Wrong result of parsing Path: %s, got: %s; want: %s", test.in, got, test.want)
}
}
}
@@ -65,17 +65,17 @@ func TestURLParse(t *testing.T) {
func TestInvalidURLParse(t *testing.T) {
invalidURLs := []string{
"",
//TODO: This URL is technically a correct scp-like syntax. Not sure how to handle it
//TODO: This Path is technically a correct scp-like syntax. Not sure how to handle it
"github.com:grdl/git-git.get.git",
//TODO: Is this a valid git URL?
//TODO: Is this a valid git Path?
//"git@github.com:1234:grdl/git-get.git",
}
for _, in := range invalidURLs {
got, err := ParseURL(in)
if err == nil {
t.Errorf("Wrong result of parsing invalid URL: %s, got: %s, want: error", in, got)
t.Errorf("Wrong result of parsing invalid Path: %s, got: %s, want: error", in, got)
}
}
}