mirror of
https://github.com/mgechev/revive.git
synced 2024-11-28 08:49:11 +02:00
16 lines
406 B
Go
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}})
|
|
}
|