-
-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathlint_test.go
More file actions
34 lines (27 loc) · 670 Bytes
/
lint_test.go
File metadata and controls
34 lines (27 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package lint_test
import (
"testing"
. "honnef.co/go/tools/lint"
"honnef.co/go/tools/lint/testutil"
)
type testChecker struct{}
func (testChecker) Name() string { return "stylecheck" }
func (testChecker) Prefix() string { return "TEST" }
func (testChecker) Init(prog *Program) {}
func (testChecker) Checks() []Check {
return []Check{
{ID: "TEST1000", FilterGenerated: false, Fn: testLint},
}
}
func testLint(j *Job) {
// Flag all functions
for _, fn := range j.Program.InitialFunctions {
if fn.Synthetic == "" {
j.Errorf(fn, "This is a test problem")
}
}
}
func TestAll(t *testing.T) {
c := testChecker{}
testutil.TestAll(t, c, "")
}