1
0
mirror of https://github.com/mgechev/revive.git synced 2025-02-01 13:07:44 +02:00
revive/test/superfluous-else_test.go
Miles Delahunty ae07914dc4
ifelse: option to preserve variable scope (#832)
* ifelse: option to preserve variable scope
2023-05-23 10:10:09 +02:00

16 lines
419 B
Go

package test
import (
"testing"
"github.com/mgechev/revive/internal/ifelse"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
// TestSuperfluousElse rule.
func TestSuperfluousElse(t *testing.T) {
testRule(t, "superfluous-else", &rule.SuperfluousElseRule{})
testRule(t, "superfluous-else-scope", &rule.SuperfluousElseRule{}, &lint.RuleConfig{Arguments: []interface{}{ifelse.PreserveScope}})
}