diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-05-08 19:02:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 19:02:17 +0100 |
commit | f7ecf3f47a22de588c241cd17d75331875097110 (patch) | |
tree | d75173623b49f821f5581c1a298eb848a1f10625 /test/command_callback | |
parent | 7541a40859040d4cd2a5d504cc41ccb1237013b4 (diff) | |
parent | 3bc07b482bfae9211f96b3a737650fc4987536cb (diff) | |
download | ale-f7ecf3f47a22de588c241cd17d75331875097110.zip |
Merge pull request #1555 from BobuSumisu/nasm-linter
Added NASM assembly linter
Diffstat (limited to 'test/command_callback')
-rw-r--r-- | test/command_callback/test_nasm_nasm_command_callbacks.vader | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/command_callback/test_nasm_nasm_command_callbacks.vader b/test/command_callback/test_nasm_nasm_command_callbacks.vader new file mode 100644 index 00000000..5053e536 --- /dev/null +++ b/test/command_callback/test_nasm_nasm_command_callbacks.vader @@ -0,0 +1,52 @@ +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 + + let b:command_tail = + \ ' -X gnu -I ' . ale#Escape(getcwd() . (has('win32') ? '\' : '/')) . ' %s' + let b:command_tail_opt = + \ ' -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' + + 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('')) + + let b:ale_nasm_nasm_executable = '~/nasm' + + AssertEqual + \ ale#Escape('~/nasm') . b:command_tail, + \ ale_linters#nasm#nasm#GetCommand(bufnr('')) + +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('')) + +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('')) |