File: writer_test.go

package info (click to toggle)
golang-github-reviewdog-errorformat 0.0~git20220309.b075c45-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 900 kB
  • sloc: python: 59; xml: 13; javascript: 4; sh: 4; haskell: 3; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package writer

import (
	"fmt"

	"github.com/reviewdog/errorformat"
)

var testErrs = []*errorformat.Entry{
	{Filename: "path/to/file1", Lnum: 1, EndLnum: 2, Col: 14, EndCol: 15, Text: "hello", Type: 'W'},
	{Filename: "path/to/file1", Lnum: 2, Col: 14, Text: "vim", Type: 'I'},
	{Filename: "file2", Lnum: 2, Col: 14, Text: "emacs", Type: 'E', Nr: 1},
	{Filename: "file2", Lnum: 14, Col: 1, Text: "neovim", Type: 'E', Nr: 14},
}

func init() {
	for _, e := range testErrs {
		e.Lines = append(e.Lines, fmt.Sprintf("%s:%d:%d:[%s] %s",
			e.Filename, e.Lnum, e.Col, string(e.Type), e.Text))
	}
}