1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/test/early-return_test.go
2023-09-24 08:44:02 +02:00

16 lines
406 B
Go

package test
import (
"testing"
"github.com/mgechev/revive/internal/ifelse"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
// TestEarlyReturn tests early-return rule.
func TestEarlyReturn(t *testing.T) {
testRule(t, "early-return", &rule.EarlyReturnRule{})
testRule(t, "early-return-scope", &rule.EarlyReturnRule{}, &lint.RuleConfig{Arguments: []any{ifelse.PreserveScope}})
}