2017-04-29 12:33:18 -04:00
|
|
|
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):
|
2017-11-15 11:34:30 -05:00
|
|
|
call ale#test#SetFilename('app/test.go')
|
2017-04-29 12:33:18 -04:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 27,
|
|
|
|
\ 'col': 0,
|
|
|
|
\ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
|
|
|
|
\ 'type': 'E',
|
2017-11-15 11:34:30 -05:00
|
|
|
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'),
|
2017-04-29 12:33:18 -04:00
|
|
|
\ },
|
|
|
|
\ ],
|
2017-05-06 05:10:24 -04:00
|
|
|
\ ale_linters#go#gobuild#Handler(bufnr(''), [
|
2017-11-15 11:34:30 -05:00
|
|
|
\ 'test.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
|
2017-04-29 12:33:18 -04:00
|
|
|
\ ])
|