2021-10-14 20:56:29 +02:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/mgechev/revive/lint"
|
|
|
|
"github.com/mgechev/revive/rule"
|
|
|
|
)
|
|
|
|
|
2024-11-20 21:19:17 +02:00
|
|
|
func TestBannedCharactersDefault(t *testing.T) {
|
|
|
|
testRule(t, "banned_characters_default", &rule.BannedCharsRule{}, &lint.RuleConfig{})
|
|
|
|
}
|
|
|
|
|
2021-10-14 20:56:29 +02:00
|
|
|
// 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) {
|
2024-11-11 13:39:10 +02:00
|
|
|
testRule(t, "banned_characters", &rule.BannedCharsRule{}, &lint.RuleConfig{
|
2023-09-24 08:44:02 +02:00
|
|
|
Arguments: []any{"Ω", "Σ", "σ", "1"},
|
2021-10-14 20:56:29 +02:00
|
|
|
})
|
|
|
|
}
|