1
0
mirror of https://github.com/mgechev/revive.git synced 2025-07-17 01:12:27 +02:00

Improve tests

This commit is contained in:
mgechev
2018-01-26 19:51:56 -08:00
parent e2e5db7203
commit 6b50d1f05c
2 changed files with 28 additions and 1 deletions

View File

@ -60,6 +60,9 @@ func TestVarDeclaration(t *testing.T) {
testRule(t, "cyclomatic", &rule.CyclomaticRule{}, &lint.RuleConfig{
Arguments: []string{"1"},
})
testRule(t, "cyclomatic-2", &rule.CyclomaticRule{}, &lint.RuleConfig{
Arguments: []string{"3"},
})
}
func testRule(t *testing.T, filename string, rule lint.Rule, config ...*lint.RuleConfig) {
@ -91,7 +94,8 @@ func TestAll(t *testing.T) {
baseDir := "../fixtures/"
ignoreFiles := map[string]bool{
"cyclomatic.go": true,
"cyclomatic.go": true,
"cyclomatic-2.go": true,
}
rx, err := regexp.Compile(*lintMatch)