1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/test/add-constant_test.go
Songlin Yang 7ef710a0c2
fix(1007): return Sel.Name as FuncName when selector is an CallExpr (#1012)
Signed-off-by: lsytj0413 <511121939@qq.com>
2024-07-19 10:33:27 +02:00

23 lines
474 B
Go

package test
import (
"testing"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
func TestAddConstant(t *testing.T) {
args := []any{map[string]any{
"maxLitCount": "2",
"allowStrs": "\"\"",
"allowInts": "0,1,2",
"allowFloats": "0.0,1.0",
"ignoreFuncs": "os\\.(CreateFile|WriteFile|Chmod|FindProcess),\\.Println,ignoredFunc,\\.Info",
}}
testRule(t, "add-constant", &rule.AddConstantRule{}, &lint.RuleConfig{
Arguments: args,
})
}