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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user