golangci-lint/pkg/result/processors/uniq_by_line_test.go
Denis Isaev 3d78f64b60 fix #522: run misspell in text mode
Treat Go source files as plain text files by misspell: it allows detecting
issues in strings, variable names, etc. Also, it's the default mode of
a standalone misspell tool.

Also, implement richer and more stable auto-fix of misspell issues:
now it can fix multiple issues in one line.
2019-06-09 20:14:19 +03:00

32 lines
664 B
Go

package processors
import (
"go/token"
"testing"
"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/result"
)
func newFLIssue(file string, line int) result.Issue {
return result.Issue{
Pos: token.Position{
Filename: file,
Line: line,
},
}
}
func TestUniqByLine(t *testing.T) {
p := NewUniqByLine(&config.Config{})
i1 := newFLIssue("f1", 1)
processAssertSame(t, p, i1)
processAssertEmpty(t, p, i1) // check skipping
processAssertEmpty(t, p, i1) // check accumulated error
processAssertSame(t, p, newFLIssue("f1", 2)) // another line
processAssertSame(t, p, newFLIssue("f2", 1)) // another file
}