1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00
revive/test/function-length_test.go

27 lines
651 B
Go
Raw Normal View History

2021-03-21 00:45:30 +02:00
package test
import (
"testing"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
func TestFuncLengthLimitsStatements(t *testing.T) {
testRule(t, "function-length1", &rule.FunctionLength{}, &lint.RuleConfig{
Arguments: []interface{}{int64(2), int64(100)},
})
}
func TestFuncLengthLimitsLines(t *testing.T) {
testRule(t, "function-length2", &rule.FunctionLength{}, &lint.RuleConfig{
Arguments: []interface{}{int64(100), int64(5)},
})
}
func TestFuncLengthLimitsDeactivated(t *testing.T) {
testRule(t, "function-length3", &rule.FunctionLength{}, &lint.RuleConfig{
Arguments: []interface{}{int64(0), int64(0)},
})
}