-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathanalyzer_test.go
44 lines (39 loc) · 884 Bytes
/
analyzer_test.go
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
35
36
37
38
39
40
41
42
43
44
package recvcheck_test
import (
"testing"
"github.com/raeperd/recvcheck"
"golang.org/x/tools/go/analysis/analysistest"
)
func TestAnalyzer(t *testing.T) {
testCases := []struct {
desc string
settings recvcheck.Settings
}{
{
desc: "basic",
settings: recvcheck.Settings{},
},
{
desc: "builtinmethods",
settings: recvcheck.Settings{},
},
{
desc: "disablebuiltin",
settings: recvcheck.Settings{DisableBuiltin: true},
},
{
desc: "exclusions",
settings: recvcheck.Settings{Exclusions: []string{"SQL.Value"}},
},
{
desc: "exclusionswildcard",
settings: recvcheck.Settings{Exclusions: []string{"*.Value"}},
},
}
for _, test := range testCases {
t.Run(test.desc, func(t *testing.T) {
a := recvcheck.NewAnalyzer(test.settings)
analysistest.Run(t, analysistest.TestData(), a, test.desc)
})
}
}