diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-15 18:24:53 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-15 18:28:28 +0100 |
commit | a42999a639b2916b769a85f37d037be314d9d61b (patch) | |
tree | 5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_cpp_cquery_command_callbacks.vader | |
parent | 5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff) | |
download | ale-a42999a639b2916b769a85f37d037be314d9d61b.zip |
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_cpp_cquery_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_cpp_cquery_command_callbacks.vader | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/test/command_callback/test_cpp_cquery_command_callbacks.vader b/test/command_callback/test_cpp_cquery_command_callbacks.vader index 89a3e225..b355d052 100644 --- a/test/command_callback/test_cpp_cquery_command_callbacks.vader +++ b/test/command_callback/test_cpp_cquery_command_callbacks.vader @@ -2,47 +2,21 @@ " 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 + call ale#assert#SetUpLinterTest('cpp', 'cquery') After: - Restore - unlet! b:ale_cpp_cquery_executable - unlet! b:ale_cpp_cquery_cache_directory - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() 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('')) + AssertLinter 'cquery', ale#Escape('cquery') let b:ale_cpp_cquery_executable = 'foobar' - AssertEqual - \ ale#Escape('foobar'), - \ ale_linters#cpp#cquery#GetCommand(bufnr('')) + AssertLinter 'foobar', ale#Escape('foobar') Execute(The cache directory should be configurable): - AssertEqual - \ {'cacheDirectory': expand('$HOME/.cache/cquery')}, - \ ale_linters#cpp#cquery#GetInitializationOptions(bufnr('')) + AssertLSPOptions {'cacheDirectory': expand('$HOME/.cache/cquery')} let b:ale_cpp_cquery_cache_directory = '/foo/bar' - AssertEqual - \ {'cacheDirectory': '/foo/bar'}, - \ ale_linters#cpp#cquery#GetInitializationOptions(bufnr('')) + AssertLSPOptions {'cacheDirectory': '/foo/bar'} |