File: test_gobuild_handler.vader

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (45 lines) | stat: -rw-r--r-- 1,382 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Before:
  runtime ale_linters/go/gobuild.vim

After:
  call ale#linter#Reset()

Execute (The gobuild handler should handle names with spaces):
  " We can't test Windows paths with the path resovling on Linux, but we can
  " test the regex.
  AssertEqual
  \ [
  \   [
  \     'C:\something\file with spaces.go',
  \     '27',
  \     '',
  \     'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
  \   ],
  \   [
  \     'C:\something\file with spaces.go',
  \     '5',
  \     '2',
  \     'expected declaration, found ''STRING'' "log"',
  \   ],
  \ ],
  \ map(ale_linters#go#gobuild#GetMatches([
  \   'C:\something\file with spaces.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
  \   'C:\something\file with spaces.go:5:2: expected declaration, found ''STRING'' "log"',
  \ ]), 'v:val[1:4]')

Execute (The gobuild handler should handle relative paths correctly):
  call ale#test#SetFilename('app/test.go')

  AssertEqual
  \ [
  \   {
  \     'lnum': 27,
  \     'col': 0,
  \     'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
  \     'type': 'E',
  \     'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
  \   },
  \ ],
  \ ale_linters#go#gobuild#Handler(bufnr(''), [
  \   'test.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
  \ ])