diff options
author | Ben Falconer <ben@falconers.me.uk> | 2018-06-06 17:03:15 +0100 |
---|---|---|
committer | Ben Falconer <ben@falconers.me.uk> | 2018-06-06 17:58:47 +0100 |
commit | 20db9ab7197b6341644fcddc87f82c5731852ea8 (patch) | |
tree | 507190ec5e6bfa4f5c6c156b4857da097056f725 /test/command_callback | |
parent | 641c0c797ba5dc4adac199fca4015d833a7e1f61 (diff) | |
download | ale-20db9ab7197b6341644fcddc87f82c5731852ea8.zip |
Add the cquery LSP #1475 #1594
Diffstat (limited to 'test/command_callback')
-rw-r--r-- | test/command_callback/test_cpp_cquery_command_callbacks.vader | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/command_callback/test_cpp_cquery_command_callbacks.vader b/test/command_callback/test_cpp_cquery_command_callbacks.vader new file mode 100644 index 00000000..89a3e225 --- /dev/null +++ b/test/command_callback/test_cpp_cquery_command_callbacks.vader @@ -0,0 +1,48 @@ +" Author: Ben Falconer <ben@falconers.me.uk> +" Description: A language server for C++ + +Before: + Save g:ale_cpp_cquery_executable + Save g:ale_cpp_cquery_cache_directory + + unlet! g:ale_cpp_cquery_executable + unlet! b:ale_cpp_cquery_executable + unlet! g:ale_cpp_cquery_cache_directory + unlet! b:ale_cpp_cquery_cache_directory + + runtime ale_linters/cpp/cquery.vim + +After: + Restore + unlet! b:ale_cpp_cquery_executable + unlet! b:ale_cpp_cquery_cache_directory + call ale#linter#Reset() + +Execute(The executable should be configurable): + AssertEqual 'cquery', ale_linters#cpp#cquery#GetExecutable(bufnr('')) + + let b:ale_cpp_cquery_executable = 'foobar' + + AssertEqual 'foobar', ale_linters#cpp#cquery#GetExecutable(bufnr('')) + +Execute(The executable should be used in the command): + AssertEqual + \ ale#Escape('cquery'), + \ ale_linters#cpp#cquery#GetCommand(bufnr('')) + + let b:ale_cpp_cquery_executable = 'foobar' + + AssertEqual + \ ale#Escape('foobar'), + \ ale_linters#cpp#cquery#GetCommand(bufnr('')) + +Execute(The cache directory should be configurable): + AssertEqual + \ {'cacheDirectory': expand('$HOME/.cache/cquery')}, + \ ale_linters#cpp#cquery#GetInitializationOptions(bufnr('')) + + let b:ale_cpp_cquery_cache_directory = '/foo/bar' + + AssertEqual + \ {'cacheDirectory': '/foo/bar'}, + \ ale_linters#cpp#cquery#GetInitializationOptions(bufnr('')) |