]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_gofmt_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 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_gofmt_fixer_callback.vader
1 Before:
2   Save g:ale_go_gofmt_executable
3   Save g:ale_go_gofmt_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_gofmt_executable = 'xxxinvalid'
8   let g:ale_go_gofmt_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 gofmt callback should return the correct default values):
20   call ale#test#SetFilename('../test-files/go/testfile.go')
21
22   AssertEqual
23   \ {
24   \   'command': ale#Escape('xxxinvalid'),
25   \ },
26   \ ale#fixers#gofmt#Fix(bufnr(''))
27
28 Execute(The gofmt callback should include custom gofmt options):
29   let g:ale_go_gofmt_options = "-r '(a) -> a'"
30
31   call ale#test#SetFilename('../test-files/go/testfile.go')
32
33   AssertEqual
34   \ {
35   \   'command': ale#Escape('xxxinvalid')
36   \     . ' ' . g:ale_go_gofmt_options,
37   \ },
38   \ ale#fixers#gofmt#Fix(bufnr(''))
39
40 Execute(The gofmt callback should support Go environment variables):
41   let g:ale_go_go111module = 'off'
42
43   call ale#test#SetFilename('../test-files/go/testfile.go')
44
45   AssertEqual
46   \ {
47   \   'command': ale#Env('GO111MODULE', 'off')
48   \     . ale#Escape('xxxinvalid')
49   \ },
50   \ ale#fixers#gofmt#Fix(bufnr(''))