mirror of
https://github.com/mgechev/revive.git
synced 2025-12-05 22:53:41 +02:00
new rule function-length (#504)
This commit is contained in:
26
test/function-length_test.go
Normal file
26
test/function-length_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
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)},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user