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) {
|
2024-11-11 13:39:10 +02:00
|
|
|
testRule(t, "enforce_slice_style_any", &rule.EnforceSliceStyleRule{})
|
2023-09-23 09:05:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestEnforceSliceStyle_make(t *testing.T) {
|
2024-11-11 13:39:10 +02:00
|
|
|
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) {
|
2024-11-11 13:39:10 +02:00
|
|
|
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) {
|
2024-11-11 13:39:10 +02:00
|
|
|
testRule(t, "enforce_slice_style_nil", &rule.EnforceSliceStyleRule{}, &lint.RuleConfig{
|
2024-02-26 12:58:31 +02:00
|
|
|
Arguments: []any{"nil"},
|
|
|
|
})
|
|
|
|
}
|