2024-04-20 10:20:56 +02:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/mgechev/revive/lint"
|
|
|
|
"github.com/mgechev/revive/rule"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCommentsDensity(t *testing.T) {
|
2024-11-11 13:39:10 +02:00
|
|
|
testRule(t, "comments_density_1", &rule.CommentsDensityRule{}, &lint.RuleConfig{
|
2024-04-20 10:20:56 +02:00
|
|
|
Arguments: []any{int64(60)},
|
|
|
|
})
|
|
|
|
|
2024-11-11 13:39:10 +02:00
|
|
|
testRule(t, "comments_density_2", &rule.CommentsDensityRule{}, &lint.RuleConfig{
|
2024-04-20 10:20:56 +02:00
|
|
|
Arguments: []any{int64(90)},
|
|
|
|
})
|
|
|
|
|
2024-11-11 13:39:10 +02:00
|
|
|
testRule(t, "comments_density_3", &rule.CommentsDensityRule{}, &lint.RuleConfig{})
|
2024-04-20 10:20:56 +02:00
|
|
|
}
|