diff options
author | w0rp <devw0rp@gmail.com> | 2017-12-02 20:47:01 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-12-02 20:47:01 +0000 |
commit | 2f9869de44cf4b9542fc79a4c4566aa268910b23 (patch) | |
tree | bc070097a6b7970a213855c304d7b5588aa3f8f3 /test/command_callback/test_perl_command_callback.vader | |
parent | a4f8506227ae0842adb74035eef51eba71c079e1 (diff) | |
download | ale-2f9869de44cf4b9542fc79a4c4566aa268910b23.zip |
Escape the perl executable, and cover the callbacks with tests
Diffstat (limited to 'test/command_callback/test_perl_command_callback.vader')
-rw-r--r-- | test/command_callback/test_perl_command_callback.vader | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/command_callback/test_perl_command_callback.vader b/test/command_callback/test_perl_command_callback.vader new file mode 100644 index 00000000..ba85e53b --- /dev/null +++ b/test/command_callback/test_perl_command_callback.vader @@ -0,0 +1,37 @@ +Before: + Save g:ale_perl_perl_executable + Save g:ale_perl_perl_options + + unlet! g:ale_perl_perl_executable + unlet! g:ale_perl_perl_options + + runtime ale_linters/perl/perl.vim + +After: + Restore + + unlet! b:ale_perl_perl_executable + unlet! b:ale_perl_perl_options + + call ale#linter#Reset() + +Execute(The default Perl command callback should be correct): + AssertEqual + \ 'perl', + \ ale_linters#perl#perl#GetExecutable(bufnr('')) + + AssertEqual + \ ale#Escape('perl') . ' -c -Mwarnings -Ilib %t', + \ ale_linters#perl#perl#GetCommand(bufnr('')) + +Execute(Overriding the executable and command should work): + let b:ale_perl_perl_executable = 'foobar' + let b:ale_perl_perl_options = '-w' + + AssertEqual + \ 'foobar', + \ ale_linters#perl#perl#GetExecutable(bufnr('')) + + AssertEqual + \ ale#Escape('foobar') . ' -w %t', + \ ale_linters#perl#perl#GetCommand(bufnr('')) |