All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_go_go111module
4 call ale#assert#SetUpLinterTest('go', 'bingo')
9 if isdirectory(g:dir . '/.git')
10 call delete(g:dir . '/.git', 'd')
13 unlet! b:ale_completion_enabled
14 unlet! b:ale_go_go111module
16 call ale#assert#TearDownLinterTest()
18 Execute(The default bingo executable and options should be correct):
19 AssertLinter 'bingo', ale#Escape('bingo') . ' --mode stdio'
21 Execute(The bingo executable and options should be configurable):
22 let b:ale_go_bingo_executable = 'boo'
23 let b:ale_go_bingo_options = '--mode stdio --trace'
25 AssertLinter 'boo', ale#Escape('boo') . ' --mode stdio --trace'
27 Execute(should support Go environment variables):
28 call ale#test#SetFilename('../test-files/go/go1/prj1/file.go')
29 let b:ale_go_go111module = 'on'
32 \ ale#Env('GO111MODULE', 'on') . ale#Escape('bingo') . ' --mode stdio'
34 Execute(Should return directory for 'go.mod' if found in parent directory):
35 call ale#test#SetFilename('../test-files/go/test.go')
37 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/go')
39 Execute(Should return nearest directory with '.git' if found in parent directory):
40 call ale#test#SetFilename('test.go')
41 call mkdir(g:dir . '/.git')
43 AssertLSPProject g:dir
45 Execute(Should ignore 'go.mod' and return '.git' dir if modules off):
46 call ale#test#SetFilename('../test-files/go/test.go')
48 let b:ale_go_go111module = 'off'
49 let b:parent_dir = ale#path#Simplify(g:dir . '/..')
50 let b:git_dir = b:parent_dir . '/.git'
52 if !isdirectory(b:git_dir)
56 AssertLSPProject b:parent_dir
58 call delete(b:git_dir, 'd')