2018-02-04 13:55:09 +00:00
|
|
|
Before:
|
2018-09-19 18:33:23 +00:00
|
|
|
Save g:ale_go_go_executable
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('go', 'gobuild')
|
2018-02-04 13:55:09 +00:00
|
|
|
|
2019-04-07 13:58:06 +00:00
|
|
|
GivenCommandOutput ['/foo/bar', '/foo/baz']
|
2018-02-04 13:55:09 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
After:
|
2018-09-19 18:33:23 +00:00
|
|
|
Restore
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2018-02-04 13:55:09 +00:00
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
Execute(The default command should be correct):
|
|
|
|
AssertLinterCwd '%s:h'
|
|
|
|
AssertLinter 'go', 'go test -c -o /dev/null ./'
|
2018-02-04 13:55:09 +00:00
|
|
|
|
2019-04-11 02:25:06 +00:00
|
|
|
Execute(Go environment variables should be supported):
|
|
|
|
let b:ale_go_go111module = 'on'
|
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'go', ale#Env('GO111MODULE', 'on') . 'go test -c -o /dev/null ./'
|
2019-04-11 02:25:06 +00:00
|
|
|
|
|
|
|
unlet! b:ale_go_go111module
|
|
|
|
|
2018-02-04 13:55:09 +00:00
|
|
|
Execute(Extra options should be supported):
|
|
|
|
let g:ale_go_gobuild_options = '--foo-bar'
|
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'go', 'go test --foo-bar -c -o /dev/null ./'
|
2018-09-19 18:33:23 +00:00
|
|
|
|
|
|
|
let g:ale_go_gobuild_options = ''
|
|
|
|
|
|
|
|
Execute(The executable should be configurable):
|
|
|
|
let g:ale_go_go_executable = 'foobar'
|
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'foobar', 'foobar test -c -o /dev/null ./'
|