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_nasm_nasm_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_nasm_nasm_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_nasm_nasm_command_callbacks.vader | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/test/command_callback/test_nasm_nasm_command_callbacks.vader b/test/command_callback/test_nasm_nasm_command_callbacks.vader index 5053e536..4e0cf608 100644 --- a/test/command_callback/test_nasm_nasm_command_callbacks.vader +++ b/test/command_callback/test_nasm_nasm_command_callbacks.vader @@ -1,13 +1,5 @@ Before: - Save g:ale_nasm_nasm_executable - Save g:ale_nasm_nasm_options - - unlet! g:ale_nasm_nasm_executable - unlet! b:ale_nasm_nasm_executable - unlet! g:ale_nasm_nasm_options - unlet! b:ale_nasm_nasm_options - - runtime ale_linters/nasm/nasm.vim + call ale#assert#SetUpLinterTest('nasm', 'nasm') let b:command_tail = \ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' %s' @@ -15,38 +7,25 @@ Before: \ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' -w+orphan-labels %s' After: - Restore unlet! b:command_tail unlet! b:command_tail_opt - unlet! b:ale_nasm_nasm_executable - unlet! b:ale_nasm_nasm_options - call ale#linter#Reset() - -Execute(The executable should be configurable): - AssertEqual 'nasm', ale_linters#nasm#nasm#GetExecutable(bufnr('')) - let b:ale_nasm_nasm_executable = '/opt/nasm/nasm' + call ale#assert#TearDownLinterTest() - AssertEqual '/opt/nasm/nasm', ale_linters#nasm#nasm#GetExecutable(bufnr('')) - -Execute(The executable should be used in the command): - AssertEqual - \ ale#Escape('nasm') . b:command_tail, - \ ale_linters#nasm#nasm#GetCommand(bufnr('')) +Execute(The executable should be configurable): + AssertLinter 'nasm', ale#Escape('nasm') . b:command_tail, let b:ale_nasm_nasm_executable = '~/nasm' - AssertEqual - \ ale#Escape('~/nasm') . b:command_tail, - \ ale_linters#nasm#nasm#GetCommand(bufnr('')) + AssertLinter '~/nasm', ale#Escape('~/nasm') . b:command_tail Execute(The options should be configurable): - AssertEqual '', ale_linters#nasm#nasm#GetOptions(bufnr('')) let b:ale_nasm_nasm_options = '-w-macro-params' - AssertEqual '-w-macro-params', ale_linters#nasm#nasm#GetOptions(bufnr('')) + + AssertLinter 'nasm', ale#Escape('nasm') + \ . ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' -w-macro-params %s' Execute(The options should be used in command): - let b:ale_nasm_nasm_options = '-w+orphan-labels' - AssertEqual - \ ale#Escape('nasm') . b:command_tail_opt, - \ ale_linters#nasm#nasm#GetCommand(bufnr('')) + let b:ale_nasm_nasm_options = '-w+orphan-labels' + + AssertLinter 'nasm', ale#Escape('nasm') . b:command_tail_opt |