1
0
mirror of https://github.com/mgechev/revive.git synced 2025-02-17 14:01:01 +02:00
revive/test/early_return_test.go
2024-11-11 19:31:18 +01: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}})
}