Files
goreportcard/download/download_test.go

26 lines
478 B
Go

package download
import "testing"
func TestClean(t *testing.T) {
cases := []struct {
path string
want string
}{
{"github.com/foo/bar", "github.com/foo/bar"},
{"https://github.com/foo/bar", "github.com/foo/bar"},
{"https://user@github.com/foo/bar", "github.com/foo/bar"},
}
for _, tt := range cases {
got, err := Clean(tt.path)
if err != nil {
t.Fatal(err)
}
if got != tt.want {
t.Errorf("Clean(%q) = %q, want %q", tt.path, got, tt.want)
}
}
}