mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-29 06:49:05 +08:00
20 lines
392 B
Go
20 lines
392 B
Go
package handlers
|
|
|
|
import "testing"
|
|
|
|
var dirNameTests = []struct {
|
|
url string
|
|
ver string
|
|
want string
|
|
}{
|
|
{"github.com/foo/bar", "v0.1.0", "_repos/src/github.com/foo/bar@v0.1.0"},
|
|
}
|
|
|
|
func TestDirName(t *testing.T) {
|
|
for _, tt := range dirNameTests {
|
|
if got := dirName(tt.url, tt.ver); got != tt.want {
|
|
t.Errorf("dirName(%q, %q) = %q, want %q", tt.url, tt.ver, got, tt.want)
|
|
}
|
|
}
|
|
}
|