Files
goreportcard/download/download_test.go
Nicolò Santamaria e6fde6c851 Remove vcs package since its behaviour diverges from cmd/go.
As stated in the issue https://github.com/golang/go/issues/11490
the package 'vcs' diverges significantly from cmd/go import path resolution
behaviour and thus needs to be removed for goreportcard to support
modules and versioning.
See also: https://golang.org/cl/159818.
2022-02-06 09:45:06 +09:00

27 lines
532 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"},
{"github.com/foo/bar/v2", "github.com/foo/bar/v2"},
}
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)
}
}
}