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_flawfinder_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_flawfinder_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_cpp_flawfinder_command_callbacks.vader | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/test/command_callback/test_cpp_flawfinder_command_callbacks.vader b/test/command_callback/test_cpp_flawfinder_command_callbacks.vader index 8769ec96..3f4067ea 100644 --- a/test/command_callback/test_cpp_flawfinder_command_callbacks.vader +++ b/test/command_callback/test_cpp_flawfinder_command_callbacks.vader @@ -1,51 +1,26 @@ Before: - Save g:ale_cpp_flawfinder_executable - Save g:ale_cpp_flawfinder_options - Save g:ale_cpp_flawfinder_minlevel - - unlet! g:ale_cpp_flawfinder_executable - unlet! b:ale_cpp_flawfinder_executable - unlet! g:ale_cpp_flawfinder_options - unlet! b:ale_cpp_flawfinder_options - unlet! g:ale_cpp_flawfinder_minlevel - unlet! b:ale_cpp_flawfinder_minlevel - - runtime ale_linters/cpp/flawfinder.vim + call ale#assert#SetUpLinterTest('cpp', 'flawfinder') After: - unlet! b:ale_cpp_flawfinder_executable - unlet! b:ale_cpp_flawfinder_options - unlet! b:ale_cpp_flawfinder_minlevel - - Restore - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() Execute(The flawfinder command should be correct): - AssertEqual - \ ale#Escape('flawfinder') - \ . ' -CDQS --minlevel=1 %t', - \ ale_linters#cpp#flawfinder#GetCommand(bufnr('')) + AssertLinter 'flawfinder', + \ ale#Escape('flawfinder') . ' -CDQS --minlevel=1 %t' Execute(The minlevel of flawfinder should be configurable): let b:ale_cpp_flawfinder_minlevel = 8 - AssertEqual - \ ale#Escape('flawfinder') - \ . ' -CDQS --minlevel=8 %t', - \ ale_linters#cpp#flawfinder#GetCommand(bufnr('')) + AssertLinter 'flawfinder', + \ ale#Escape('flawfinder') . ' -CDQS --minlevel=8 %t' Execute(Additional flawfinder options should be configurable): let b:ale_cpp_flawfinder_options = ' --foobar' - AssertEqual - \ ale#Escape('flawfinder') - \ . ' -CDQS --foobar --minlevel=1 %t', - \ ale_linters#cpp#flawfinder#GetCommand(bufnr('')) + AssertLinter 'flawfinder', + \ ale#Escape('flawfinder') . ' -CDQS --foobar --minlevel=1 %t' Execute(The flawfinder exectable should be configurable): let b:ale_cpp_flawfinder_executable = 'foo/bar' - AssertEqual - \ ale#Escape('foo/bar') - \ . ' -CDQS --minlevel=1 %t', - \ ale_linters#cpp#flawfinder#GetCommand(bufnr('')) + AssertLinter 'foo/bar', ale#Escape('foo/bar') . ' -CDQS --minlevel=1 %t' |