mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-29 06:49:05 +08:00
add test
This commit is contained in:
18
handlers/checks_test.go
Normal file
18
handlers/checks_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package handlers
|
||||
|
||||
import "testing"
|
||||
|
||||
var dirNameTests = []struct {
|
||||
url string
|
||||
want string
|
||||
}{
|
||||
{"https://github.com/foo/bar", "repos/src/github.com/foo/bar"},
|
||||
}
|
||||
|
||||
func TestDirName(t *testing.T) {
|
||||
for _, tt := range dirNameTests {
|
||||
if got := dirName(tt.url); got != tt.want {
|
||||
t.Errorf("dirName(%q) = %q, want %q", tt.url, got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user