mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
Adding case-sensitive exclude processor
Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@critical.today>
This commit is contained in:
parent
4958e50dfe
commit
a68b411e4a
5 changed files with 49 additions and 4 deletions
|
@ -51,3 +51,21 @@ func TestExclude(t *testing.T) {
|
|||
func TestNoExclude(t *testing.T) {
|
||||
processAssertSame(t, NewExclude(""), newTextIssue("test"))
|
||||
}
|
||||
|
||||
func TestExcludeCaseSensitive(t *testing.T) {
|
||||
p := NewExcludeCaseSensitive("^exclude$")
|
||||
texts := []string{"excLude", "1", "", "exclud", "exclude"}
|
||||
var issues []result.Issue
|
||||
for _, t := range texts {
|
||||
issues = append(issues, newTextIssue(t))
|
||||
}
|
||||
|
||||
processedIssues := process(t, p, issues...)
|
||||
assert.Len(t, processedIssues, len(issues)-1)
|
||||
|
||||
var processedTexts []string
|
||||
for _, i := range processedIssues {
|
||||
processedTexts = append(processedTexts, i.Text)
|
||||
}
|
||||
assert.Equal(t, texts[:len(texts)-1], processedTexts)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue