]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_golines_fixer_callback.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 'a39f715c13be3352193ffd9c5b7536b8786eff64' as '.vim/bundle/vim-lsp'
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_golines_fixer_callback.vader
1 Before:
2   Save g:ale_go_golines_executable
3   Save g:ale_go_golines_options
4   Save g:ale_go_go111module
5
6   " Use an invalid global executable, so we don't match it.
7   let g:ale_go_golines_executable = 'xxxinvalid'
8   let g:ale_go_golines_options = ''
9
10   call ale#test#SetDirectory('/testplugin/test/fixers')
11
12 After:
13   Restore
14
15   unlet! b:ale_go_go111module
16
17   call ale#test#RestoreDirectory()
18
19 Execute(The golines callback should return 0 when the executable isn't executable):
20   AssertEqual
21   \ 0,
22   \ ale#fixers#golines#Fix(bufnr(''))
23
24
25 Execute(The golines callback should return the correct default values):
26   let g:ale_go_golines_executable = has('win32') ? 'cmd' : 'echo'
27
28   AssertEqual
29   \ {
30   \   'command': ale#Escape(g:ale_go_golines_executable),
31   \ },
32   \ ale#fixers#golines#Fix(bufnr(''))
33
34 Execute(The golines callback should include custom golines options):
35   let g:ale_go_golines_executable = has('win32') ? 'cmd' : 'echo'
36   let g:ale_go_golines_options = "--max-len --shorten-comments"
37
38   AssertEqual
39   \ {
40   \   'command': ale#Escape(g:ale_go_golines_executable)
41   \     . ' ' . g:ale_go_golines_options,
42   \ },
43   \ ale#fixers#golines#Fix(bufnr(''))
44
45 Execute(The golines callback should support Go environment variables):
46   let g:ale_go_golines_executable = has('win32') ? 'cmd' : 'echo'
47   let g:ale_go_go111module = 'off'
48
49   AssertEqual
50   \ {
51   \   'command': ale#Env('GO111MODULE', 'off')
52   \     . ale#Escape(g:ale_go_golines_executable)
53   \ },
54   \ ale#fixers#golines#Fix(bufnr(''))