summaryrefslogtreecommitdiff
path: root/test/command_callback/test_c_flawfinder_command_callbacks.vader
blob: 38a602dd9a8647c7f01a4473077f03f67a089ea9 (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
41
42
43
44
45
46
47
48
49
50
51
Before:
  Save g:ale_c_flawfinder_executable
  Save g:ale_c_flawfinder_options
  Save g:ale_c_flawfinder_minlevel

  unlet! g:ale_c_flawfinder_executable
  unlet! b:ale_c_flawfinder_executable
  unlet! g:ale_c_flawfinder_options
  unlet! b:ale_c_flawfinder_options
  unlet! g:ale_c_flawfinder_minlevel
  unlet! b:ale_c_flawfinder_minlevel

  runtime ale_linters/c/flawfinder.vim

After:
  unlet! b:ale_c_flawfinder_executable
  unlet! b:ale_c_flawfinder_options
  unlet! b:ale_c_flawfinder_minlevel

  Restore
  call ale#linter#Reset()

Execute(The flawfinder command should be correct):
  AssertEqual
  \ ale#Escape('flawfinder')
  \   . ' -CDQS --minlevel=1 %t',
  \ ale_linters#c#flawfinder#GetCommand(bufnr(''))

Execute(The minlevel of flawfinder should be configurable):
  let b:ale_c_flawfinder_minlevel = 8

  AssertEqual
  \ ale#Escape('flawfinder')
  \   . ' -CDQS --minlevel=8 %t',
  \ ale_linters#c#flawfinder#GetCommand(bufnr(''))

Execute(Additional flawfinder options should be configurable):
  let b:ale_c_flawfinder_options = ' --foobar'

  AssertEqual
  \ ale#Escape('flawfinder')
  \   . ' -CDQS --foobar --minlevel=1 %t',
  \ ale_linters#c#flawfinder#GetCommand(bufnr(''))

Execute(The flawfinder exectable should be configurable):
  let b:ale_c_flawfinder_executable = 'foo/bar'

  AssertEqual
  \ ale#Escape('foo/bar')
  \   . ' -CDQS --minlevel=1 %t',
  \ ale_linters#c#flawfinder#GetCommand(bufnr(''))