diff options
Diffstat (limited to 'test/fixers')
-rw-r--r-- | test/fixers/test_gofmt_fixer_callback.vader | 6 | ||||
-rw-r--r-- | test/fixers/test_goimports_fixer_callback.vader | 4 | ||||
-rw-r--r-- | test/fixers/test_gomod_fixer_callback.vader | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/test/fixers/test_gofmt_fixer_callback.vader b/test/fixers/test_gofmt_fixer_callback.vader index b8376142..16659655 100644 --- a/test/fixers/test_gofmt_fixer_callback.vader +++ b/test/fixers/test_gofmt_fixer_callback.vader @@ -1,17 +1,19 @@ 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' let g:ale_go_gofmt_options = '' - let g:ale_go_go111module = '' call ale#test#SetDirectory('/testplugin/test/fixers') After: Restore + unlet! b:ale_go_go111module + call ale#test#RestoreDirectory() Execute(The gofmt callback should return the correct default values): @@ -28,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 @@ -42,6 +45,7 @@ Execute(The gofmt callback should include custom gofmt options): Execute(The gofmt callback should support Go environment variables): let g:ale_go_go111module = 'off' + call ale#test#SetFilename('../go_files/testfile.go') AssertEqual diff --git a/test/fixers/test_goimports_fixer_callback.vader b/test/fixers/test_goimports_fixer_callback.vader index a1b72425..3ea022ff 100644 --- a/test/fixers/test_goimports_fixer_callback.vader +++ b/test/fixers/test_goimports_fixer_callback.vader @@ -1,11 +1,11 @@ Before: Save g:ale_go_goimports_executable Save g:ale_go_goimports_options + Save g:ale_go_go111module " Use an invalid global executable, so we don't match it. let g:ale_go_goimports_executable = 'xxxinvalid' let g:ale_go_goimports_options = '' - let g:ale_go_go111module = '' call ale#test#SetDirectory('/testplugin/test/fixers') call ale#test#SetFilename('../go_files/testfile.go') @@ -13,6 +13,8 @@ Before: After: Restore + unlet! b:ale_go_go111module + call ale#test#RestoreDirectory() Execute(The goimports callback should return 0 when the executable isn't executable): diff --git a/test/fixers/test_gomod_fixer_callback.vader b/test/fixers/test_gomod_fixer_callback.vader index 40658223..422caf63 100644 --- a/test/fixers/test_gomod_fixer_callback.vader +++ b/test/fixers/test_gomod_fixer_callback.vader @@ -1,5 +1,6 @@ Before: Save g:ale_go_go_executable + Save g:ale_go_go111module " Use an invalid global executable, so we don't match it. let g:ale_go_go_executable = 'xxxinvalid' @@ -9,6 +10,8 @@ Before: After: Restore + unlet! b:ale_go_go111module + call ale#test#RestoreDirectory() Execute(The gomod callback should return the correct default values): |