blob: 0e079a73bc03a07f23a4de9d739d61e4e8fc352a (
plain)
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
46
|
Before:
call ale#assert#SetUpLinterTest('go', 'gopls')
After:
Restore
if isdirectory(g:dir . '/.git')
call delete(g:dir . '/.git', 'd')
endif
unlet! b:ale_completion_enabled
call ale#assert#TearDownLinterTest()
Execute(should set correct defaults):
AssertLinter 'gopls', ale#Escape('gopls') . ' --mode stdio'
Execute(should configure gopls callback executable):
let b:ale_go_gopls_executable = 'boo'
let b:ale_go_gopls_options = ''
AssertLinter 'boo', ale#Escape('boo')
Execute(should set gopls options):
call ale#test#SetFilename('go_paths/go1/prj1/file.go')
" let b:ale_completion_enabled = 1
let b:ale_go_gopls_options = ''
AssertLinter 'gopls',
\ ale#Escape('gopls') . ''
let b:ale_go_gopls_options = '--mode stdio --trace'
AssertLinter 'gopls',
\ ale#Escape('gopls') . ' --mode stdio --trace'
Execute(Should return directory for 'go.mod' if found in parent directory):
call ale#test#SetFilename('../go_files/test.go')
AssertLSPProject ale#path#Simplify(g:dir . '/../go_files')
Execute(Should return nearest directory with '.git' if found in parent directory):
call ale#test#SetFilename('test.go')
call mkdir(g:dir . '/.git')
AssertLSPProject g:dir
|