mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
add check_test
This commit is contained in:
16
check/check_test.go
Normal file
16
check/check_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRun(t *testing.T) {
|
||||
cr, err := Run("testrepo")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if cr.Issues != 2 {
|
||||
t.Errorf("got cr.Issues = %d, want %d", cr.Issues, 2)
|
||||
}
|
||||
}
|
||||
8
check/testrepo/a.go
Normal file
8
check/testrepo/a.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// obivous typo
|
||||
fmt.Println("invalid %s")
|
||||
}
|
||||
Reference in New Issue
Block a user