diff options
Diffstat (limited to 'test/fixers/test_gofmt_fixer_callback.vader')
-rw-r--r-- | test/fixers/test_gofmt_fixer_callback.vader | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/fixers/test_gofmt_fixer_callback.vader b/test/fixers/test_gofmt_fixer_callback.vader index 14e6e063..16659655 100644 --- a/test/fixers/test_gofmt_fixer_callback.vader +++ b/test/fixers/test_gofmt_fixer_callback.vader @@ -1,6 +1,7 @@ Before: Save g:ale_go_gofmt_executable Save g:ale_go_gofmt_options + Save g:ale_go_go111module " Use an invalid global executable, so we don't match it. let g:ale_go_gofmt_executable = 'xxxinvalid' @@ -11,6 +12,8 @@ Before: After: Restore + unlet! b:ale_go_go111module + call ale#test#RestoreDirectory() Execute(The gofmt callback should return the correct default values): @@ -27,6 +30,7 @@ Execute(The gofmt callback should return the correct default values): Execute(The gofmt callback should include custom gofmt options): let g:ale_go_gofmt_options = "-r '(a) -> a'" + call ale#test#SetFilename('../go_files/testfile.go') AssertEqual @@ -38,3 +42,17 @@ Execute(The gofmt callback should include custom gofmt options): \ . ' %t', \ }, \ ale#fixers#gofmt#Fix(bufnr('')) + +Execute(The gofmt callback should support Go environment variables): + let g:ale_go_go111module = 'off' + + call ale#test#SetFilename('../go_files/testfile.go') + + AssertEqual + \ { + \ 'read_temporary_file': 1, + \ 'command': ale#Env('GO111MODULE', 'off') + \ . ale#Escape('xxxinvalid') . ' -l -w' + \ . ' %t', + \ }, + \ ale#fixers#gofmt#Fix(bufnr('')) |