2023-09-23 09:05:52 +02:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/mgechev/revive/lint"
|
|
|
|
"github.com/mgechev/revive/rule"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestEnforceSliceStyle_any(t *testing.T) {
|
|
|
|
testRule(t, "enforce-slice-style-any", &rule.EnforceSliceStyleRule{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestEnforceSliceStyle_make(t *testing.T) {
|
|
|
|
testRule(t, "enforce-slice-style-make", &rule.EnforceSliceStyleRule{}, &lint.RuleConfig{
|
2023-09-24 08:44:02 +02:00
|
|
|
Arguments: []any{"make"},
|
2023-09-23 09:05:52 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestEnforceSliceStyle_literal(t *testing.T) {
|
|
|
|
testRule(t, "enforce-slice-style-literal", &rule.EnforceSliceStyleRule{}, &lint.RuleConfig{
|
2023-09-24 08:44:02 +02:00
|
|
|
Arguments: []any{"literal"},
|
2023-09-23 09:05:52 +02:00
|
|
|
})
|
|
|
|
}
|
2024-02-26 12:58:31 +02:00
|
|
|
|
|
|
|
func TestEnforceSliceStyle_nil(t *testing.T) {
|
|
|
|
testRule(t, "enforce-slice-style-nil", &rule.EnforceSliceStyleRule{}, &lint.RuleConfig{
|
|
|
|
Arguments: []any{"nil"},
|
|
|
|
})
|
|
|
|
}
|