]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_gomod_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:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_gomod_fixer_callback.vader
1 Before:
2   Save g:ale_go_go_executable
3   Save g:ale_go_go111module
4
5   " Use an invalid global executable, so we don't match it.
6   let g:ale_go_go_executable = 'xxxinvalid'
7   let g:ale_go_go111module = ''
8   call ale#test#SetDirectory('/testplugin/test/fixers')
9
10 After:
11   Restore
12
13   unlet! b:ale_go_go111module
14
15   call ale#test#RestoreDirectory()
16
17 Execute(The gomod callback should return the correct default values):
18   call ale#test#SetFilename('../test-files/go/go.mod')
19   setl filetype=gomod
20
21   AssertEqual
22   \ {
23   \   'read_temporary_file': 1,
24   \   'command': ale#Escape('xxxinvalid')
25   \     . ' mod edit -fmt'
26   \     . ' %t',
27   \ },
28   \ ale#fixers#gomod#Fix(bufnr(''))
29
30 Execute(The gomod callback should support Go environment variables):
31   call ale#test#SetFilename('../test-files/go/go.mod')
32   setl filetype=gomod
33   let g:ale_go_go111module = 'on'
34
35   AssertEqual
36   \ {
37   \   'read_temporary_file': 1,
38   \   'command': ale#Env('GO111MODULE', 'on')
39   \     . ale#Escape('xxxinvalid') . ' mod edit -fmt %t'
40   \ },
41   \ ale#fixers#gomod#Fix(bufnr(''))