summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_cpp_cquery_command_callbacks.vader48
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(''))