summaryrefslogtreecommitdiff
path: root/test/command_callback/test_perl_command_callback.vader
blob: e82f22794ff6c31103601e9e03e10d682d998c33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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(''))