summaryrefslogtreecommitdiff
path: root/test/command_callback/test_llc_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-15 18:24:53 +0100
committerw0rp <devw0rp@gmail.com>2018-07-15 18:28:28 +0100
commita42999a639b2916b769a85f37d037be314d9d61b (patch)
tree5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_llc_command_callback.vader
parent5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff)
downloadale-a42999a639b2916b769a85f37d037be314d9d61b.zip
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_llc_command_callback.vader')
-rw-r--r--test/command_callback/test_llc_command_callback.vader34
1 files changed, 8 insertions, 26 deletions
diff --git a/test/command_callback/test_llc_command_callback.vader b/test/command_callback/test_llc_command_callback.vader
index 296b277a..a0caaa48 100644
--- a/test/command_callback/test_llc_command_callback.vader
+++ b/test/command_callback/test_llc_command_callback.vader
@@ -1,10 +1,5 @@
Before:
- Save g:ale_llvm_llc_executable
-
- unlet! g:ale_llvm_llc_executable
- unlet! b:ale_llvm_llc_executable
-
- runtime ale_linters/llvm/llc.vim
+ call ale#assert#SetUpLinterTest('llvm', 'llc')
function! AssertHasPrefix(str, prefix) abort
let msg = printf("'%s' is expected to be prefixed with '%s'", a:str, a:prefix)
@@ -12,28 +7,15 @@ Before:
endfunction
After:
- unlet! g:ale_llvm_llc_executable
- unlet! b:ale_llvm_llc_executable
delfunction AssertHasPrefix
- Restore
-Execute(llc command is customizable):
- let cmd = ale_linters#llvm#llc#GetCommand(bufnr(''))
- call AssertHasPrefix(cmd, ale#Escape('llc'))
+ call ale#assert#TearDownLinterTest()
- let g:ale_llvm_llc_executable = 'llc-5.0'
- let cmd = ale_linters#llvm#llc#GetCommand(bufnr(''))
- call AssertHasPrefix(cmd, ale#Escape('llc-5.0'))
+Execute(The llc command should be customizable):
+ AssertLinter 'llc',
+ \ ale#Escape('llc') . ' -filetype=null -o=' . g:ale#util#nul_file
- let b:ale_llvm_llc_executable = 'llc-4.0'
- let cmd = ale_linters#llvm#llc#GetCommand(bufnr(''))
- call AssertHasPrefix(cmd, ale#Escape('llc-4.0'))
-
-Execute(GetCommand() escapes the returned path):
- let b:ale_llvm_llc_executable = '/path/space contained/llc'
- let cmd = ale_linters#llvm#llc#GetCommand(bufnr(''))
- call AssertHasPrefix(cmd, ale#Escape('/path/space contained/llc'))
+ let g:ale_llvm_llc_executable = 'llc-5.0'
-Execute(GetExecutable() does not escape the returned path):
- let b:ale_llvm_llc_executable = '/path/space contained/llc'
- AssertEqual ale_linters#llvm#llc#GetExecutable(bufnr('')), '/path/space contained/llc'
+ AssertLinter 'llc-5.0',
+ \ ale#Escape('llc-5.0') . ' -filetype=null -o=' . g:ale#util#nul_file