ale/test/command_callback/test_cpp_flawfinder_command_callbacks.vader

52 lines
1.4 KiB
Plaintext
Raw Normal View History

Before:
Save g:ale_cpp_flawfinder_executable
Save g:ale_cpp_flawfinder_options
Save g:ale_cpp_flawfinder_minlevel
unlet! g:ale_cpp_flawfinder_executable
unlet! b:ale_cpp_flawfinder_executable
unlet! g:ale_cpp_flawfinder_options
unlet! b:ale_cpp_flawfinder_options
unlet! g:ale_cpp_flawfinder_minlevel
unlet! b:ale_cpp_flawfinder_minlevel
runtime ale_linters/cpp/flawfinder.vim
After:
unlet! b:ale_cpp_flawfinder_executable
unlet! b:ale_cpp_flawfinder_options
unlet! b:ale_cpp_flawfinder_minlevel
Restore
call ale#linter#Reset()
Execute(The flawfinder command should be correct):
AssertEqual
\ ale#Escape('flawfinder')
\ . ' -CDQS --minlevel=1 %t',
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
Execute(The minlevel of flawfinder should be configurable):
let b:ale_cpp_flawfinder_minlevel = 8
AssertEqual
\ ale#Escape('flawfinder')
\ . ' -CDQS --minlevel=8 %t',
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
Execute(Additional flawfinder options should be configurable):
let b:ale_cpp_flawfinder_options = ' --foobar'
AssertEqual
\ ale#Escape('flawfinder')
\ . ' -CDQS --foobar --minlevel=1 %t',
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))
Execute(The flawfinder exectable should be configurable):
let b:ale_cpp_flawfinder_executable = 'foo/bar'
AssertEqual
\ ale#Escape('foo/bar')
\ . ' -CDQS --minlevel=1 %t',
\ ale_linters#cpp#flawfinder#GetCommand(bufnr(''))