]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_bingo.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_bingo.vader
1 Before:
2   Save g:ale_go_go111module
3
4   call ale#assert#SetUpLinterTest('go', 'bingo')
5
6 After:
7   Restore
8
9   if isdirectory(g:dir . '/.git')
10     call delete(g:dir . '/.git', 'd')
11   endif
12
13   unlet! b:ale_completion_enabled
14   unlet! b:ale_go_go111module
15
16   call ale#assert#TearDownLinterTest()
17
18 Execute(The default bingo executable and options should be correct):
19   AssertLinter 'bingo', ale#Escape('bingo') . ' --mode stdio'
20
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'
24
25   AssertLinter 'boo', ale#Escape('boo') . ' --mode stdio --trace'
26
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'
30
31   AssertLinter 'bingo',
32   \ ale#Env('GO111MODULE', 'on') . ale#Escape('bingo') . ' --mode stdio'
33
34 Execute(Should return directory for 'go.mod' if found in parent directory):
35   call ale#test#SetFilename('../test-files/go/test.go')
36
37   AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/go')
38
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')
42
43   AssertLSPProject g:dir
44
45 Execute(Should ignore 'go.mod' and return '.git' dir if modules off):
46   call ale#test#SetFilename('../test-files/go/test.go')
47
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'
51
52   if !isdirectory(b:git_dir)
53     call mkdir(b:git_dir)
54   endif
55
56   AssertLSPProject b:parent_dir
57
58   call delete(b:git_dir, 'd')
59   unlet! b:parent_dir
60   unlet! b:git_dir