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_asm_gcc_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_asm_gcc_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_asm_gcc_command_callbacks.vader | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/test/command_callback/test_asm_gcc_command_callbacks.vader b/test/command_callback/test_asm_gcc_command_callbacks.vader index ce8b906a..5ad31186 100644 --- a/test/command_callback/test_asm_gcc_command_callbacks.vader +++ b/test/command_callback/test_asm_gcc_command_callbacks.vader @@ -1,39 +1,18 @@ Before: - Save g:ale_asm_gcc_executable - Save g:ale_asm_gcc_options - - unlet! g:ale_asm_gcc_executable - unlet! b:ale_asm_gcc_executable - unlet! g:ale_asm_gcc_options - unlet! b:ale_asm_gcc_options - - runtime ale_linters/asm/gcc.vim - + call ale#assert#SetUpLinterTest('asm', 'gcc') + call ale#test#SetFilename('test.cpp') let b:command_tail = ' -x assembler -fsyntax-only -iquote' - \ . ' ' . ale#Escape(getcwd()) + \ . ' ' . ale#Escape(g:dir) \ . ' -Wall -' After: - Restore unlet! b:command_tail - unlet! b:ale_asm_gcc_executable - unlet! b:ale_asm_gcc_options - call ale#linter#Reset() - -Execute(The executable should be configurable): - AssertEqual 'gcc', ale_linters#asm#gcc#GetExecutable(bufnr('')) - - let b:ale_asm_gcc_executable = 'foobar' - AssertEqual 'foobar', ale_linters#asm#gcc#GetExecutable(bufnr('')) + call ale#assert#TearDownLinterTest() -Execute(The executable should be used in the command): - AssertEqual - \ ale#Escape('gcc') . b:command_tail, - \ ale_linters#asm#gcc#GetCommand(bufnr('')) +Execute(The executable should be configurable): + AssertLinter 'gcc', ale#Escape('gcc') . b:command_tail let b:ale_asm_gcc_executable = 'foobar' - AssertEqual - \ ale#Escape('foobar') . b:command_tail, - \ ale_linters#asm#gcc#GetCommand(bufnr('')) + AssertLinter 'foobar', ale#Escape('foobar') . b:command_tail |