Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / lint / lintutil / util_test.go
1 package lintutil
2
3 import (
4         "go/token"
5         "testing"
6 )
7
8 func TestParsePos(t *testing.T) {
9         var tests = []struct {
10                 in  string
11                 out token.Position
12         }{
13                 {
14                         "/tmp/gopackages280076669/go-build/net/cgo_linux.cgo1.go:1",
15                         token.Position{
16                                 Filename: "/tmp/gopackages280076669/go-build/net/cgo_linux.cgo1.go",
17                                 Line:     1,
18                                 Column:   0,
19                         },
20                 },
21                 {
22                         "/tmp/gopackages280076669/go-build/net/cgo_linux.cgo1.go:1:",
23                         token.Position{
24                                 Filename: "/tmp/gopackages280076669/go-build/net/cgo_linux.cgo1.go",
25                                 Line:     1,
26                                 Column:   0,
27                         },
28                 },
29                 {
30                         "/tmp/gopackages280076669/go-build/net/cgo_linux.cgo1.go:23:43",
31                         token.Position{
32                                 Filename: "/tmp/gopackages280076669/go-build/net/cgo_linux.cgo1.go",
33                                 Line:     23,
34                                 Column:   43,
35                         },
36                 },
37         }
38
39         for _, tt := range tests {
40                 res := parsePos(tt.in)
41                 if res != tt.out {
42                         t.Errorf("failed to parse %q correctly", tt.in)
43                 }
44         }
45 }