diff options
author | Martin Tournoij <martin@arp242.net> | 2018-09-19 19:33:23 +0100 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2018-09-19 19:33:23 +0100 |
commit | e82bcdb8a6dc888130c03bc80cba492051c5ffbf (patch) | |
tree | 7ac138a0990261e3ff70f518a5a01dc311a31230 /test/fixers | |
parent | a6c6e24d61c3d67f46cb9e3d5a8d4c8475b8a8c6 (diff) | |
download | ale-e82bcdb8a6dc888130c03bc80cba492051c5ffbf.zip |
Add fixer for Go modules (#1873)
* Add fixer for Go modules
Diffstat (limited to 'test/fixers')
-rw-r--r-- | test/fixers/test_gomod_fixer_callback.vader | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fixers/test_gomod_fixer_callback.vader b/test/fixers/test_gomod_fixer_callback.vader new file mode 100644 index 00000000..a378e961 --- /dev/null +++ b/test/fixers/test_gomod_fixer_callback.vader @@ -0,0 +1,24 @@ +Before: + Save g:ale_go_go_executable + + " Use an invalid global executable, so we don't match it. + let g:ale_go_go_executable = 'xxxinvalid' + call ale#test#SetDirectory('/testplugin/test/fixers') + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The gomod callback should return the correct default values): + call ale#test#SetFilename('../go_files/go.mod') + setl ft=gomod + + AssertEqual + \ { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape('xxxinvalid') + \ . ' mod edit -fmt' + \ . ' %t', + \ }, + \ ale#fixers#gomod#Fix(bufnr('')) |