diff options
author | w0rp <devw0rp@gmail.com> | 2019-04-10 19:23:06 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2019-04-10 19:23:16 +0100 |
commit | 2e8c8085a6b98261883a88edc849e4f1a9432fc8 (patch) | |
tree | a590e9975837261e06afaee06e7c5b77a539ae1a /test/command_callback/test_gopls_command_callback.vader | |
parent | 042b351b7ab20dd67854d0294c67efc47df3b924 (diff) | |
download | ale-2e8c8085a6b98261883a88edc849e4f1a9432fc8.zip |
Close #2179 - Add support for gopls
Diffstat (limited to 'test/command_callback/test_gopls_command_callback.vader')
-rw-r--r-- | test/command_callback/test_gopls_command_callback.vader | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/command_callback/test_gopls_command_callback.vader b/test/command_callback/test_gopls_command_callback.vader new file mode 100644 index 00000000..0e079a73 --- /dev/null +++ b/test/command_callback/test_gopls_command_callback.vader @@ -0,0 +1,46 @@ +Before: + call ale#assert#SetUpLinterTest('go', 'gopls') + +After: + Restore + + if isdirectory(g:dir . '/.git') + call delete(g:dir . '/.git', 'd') + endif + + unlet! b:ale_completion_enabled + + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'gopls', ale#Escape('gopls') . ' --mode stdio' + +Execute(should configure gopls callback executable): + let b:ale_go_gopls_executable = 'boo' + let b:ale_go_gopls_options = '' + + AssertLinter 'boo', ale#Escape('boo') + +Execute(should set gopls options): + call ale#test#SetFilename('go_paths/go1/prj1/file.go') + " let b:ale_completion_enabled = 1 + let b:ale_go_gopls_options = '' + + AssertLinter 'gopls', + \ ale#Escape('gopls') . '' + + let b:ale_go_gopls_options = '--mode stdio --trace' + + AssertLinter 'gopls', + \ ale#Escape('gopls') . ' --mode stdio --trace' + +Execute(Should return directory for 'go.mod' if found in parent directory): + call ale#test#SetFilename('../go_files/test.go') + + AssertLSPProject ale#path#Simplify(g:dir . '/../go_files') + +Execute(Should return nearest directory with '.git' if found in parent directory): + call ale#test#SetFilename('test.go') + call mkdir(g:dir . '/.git') + + AssertLSPProject g:dir |