summaryrefslogtreecommitdiff
path: root/test/command_callback/test_gawk_command_callback.vader
blob: ae128fe55ec7e5bc8e3b9096815c590f7ea66d9f (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
38
39
40
Before:
  Save g:ale_awk_gawk_executable
  Save g:ale_awk_gawk_options
  unlet! g:ale_awk_gawk_executable
  unlet! g:ale_awk_gawk_options

  runtime ale_linters/awk/gawk.vim

After:
  Restore
  unlet! b:command_tail
  unlet! b:ale_awk_gawk_executable
  unlet! b:ale_awk_gawk_options

  call ale#linter#Reset()

Execute(The executable should be used in the command):
  AssertEqual
  \ 'gawk'
    \ . " --source 'BEGIN { exit } END { exit 1 }'"
    \ . '  ' . '-f %t --lint /dev/null',
  \ ale_linters#awk#gawk#GetCommand(bufnr(''))

  let b:ale_awk_gawk_executable = '/other/gawk'

  AssertEqual
  \ '/other/gawk'
    \ . " --source 'BEGIN { exit } END { exit 1 }'"
    \ . '  ' . '-f %t --lint /dev/null',
  \ ale_linters#awk#gawk#GetCommand(bufnr(''))

  let b:ale_awk_gawk_executable = 'gawk'
  let b:ale_awk_gawk_options = '--something'

  AssertEqual
  \ 'gawk'
    \ . " --source 'BEGIN { exit } END { exit 1 }'"
    \ . ' --something'
    \ . ' ' . '-f %t --lint /dev/null',
  \ ale_linters#awk#gawk#GetCommand(bufnr(''))