summaryrefslogtreecommitdiff
path: root/test/command_callback/test_vint_command_callback.vader
blob: ddf39f317cd3bff580c1fcd6f579958ea24ff955 (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
Before:
  Save g:ale_vim_vint_executable

  unlet! g:ale_vim_vint_executable

  runtime ale_linters/vim/vint.vim

  let b:command_tail = (has('nvim') ? ' --enable-neovim' : '')
  \ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})" %t'
  call ale#semver#ResetVersionCache()

After:
  Restore

  call ale#linter#Reset()
  call ale#semver#ResetVersionCache()

  unlet! b:bin_dir
  unlet! b:executable

Execute(The default command should be correct):
  AssertEqual 'vint', ale_linters#vim#vint#GetExecutable(bufnr(''))
  AssertEqual
  \ ale#Escape('vint') .' --version',
  \ ale_linters#vim#vint#VersionCommand(bufnr(''))
  AssertEqual
  \ ale#Escape('vint') .' -s --no-color' . b:command_tail,
  \ ale_linters#vim#vint#GetCommand(bufnr(''), [])

Execute(The executable should be configurable):
  let g:ale_vim_vint_executable = 'foobar'

  AssertEqual 'foobar', ale_linters#vim#vint#GetExecutable(bufnr(''))
  AssertEqual
  \ ale#Escape('foobar') .' --version',
  \ ale_linters#vim#vint#VersionCommand(bufnr(''))
  AssertEqual
  \ ale#Escape('foobar') .' -s --no-color' . b:command_tail,
  \ ale_linters#vim#vint#GetCommand(bufnr(''), [])