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

22 lines
614 B
Go
Raw Normal View History

package test
import (
"testing"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
func TestBannedCharactersDefault(t *testing.T) {
testRule(t, "banned_characters_default", &rule.BannedCharsRule{}, &lint.RuleConfig{})
}
// Test banned characters in a const, var and func names.
// One banned character is in the comment and should not be checked.
// One banned character from the list is not present in the fixture file.
func TestBannedCharacters(t *testing.T) {
testRule(t, "banned_characters", &rule.BannedCharsRule{}, &lint.RuleConfig{
Arguments: []any{"Ω", "Σ", "σ", "1"},
})
}