summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-12-02 12:26:30 +0000
committerw0rp <devw0rp@gmail.com>2017-12-02 12:26:44 +0000
commitf5fc746d00a8b8e0aaac1904ce97ad7eb52e1b24 (patch)
tree714ff39a424d158e22fcf26e28bc8b36091756e8 /test
parent83760a09521b134497c5d3299cc9962cff8ab76e (diff)
downloadale-f5fc746d00a8b8e0aaac1904ce97ad7eb52e1b24.zip
Fix #1186 - Use -w by default for Perl, which does not execute code
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_perl_command_callback.vader37
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..e82f2279
--- /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') . ' -w -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 = '-c'
+
+ AssertEqual
+ \ 'foobar',
+ \ ale_linters#perl#perl#GetExecutable(bufnr(''))
+
+ AssertEqual
+ \ ale#Escape('foobar') . ' -c %t',
+ \ ale_linters#perl#perl#GetCommand(bufnr(''))