2017-07-18 18:57:33 -04:00
|
|
|
Before:
|
|
|
|
Save g:ale_dart_dartanalyzer_executable
|
|
|
|
unlet! g:ale_dart_dartanalyzer_executable
|
|
|
|
|
|
|
|
runtime ale_linters/dart/dartanalyzer.vim
|
|
|
|
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(The default command and executable should be correct):
|
|
|
|
AssertEqual
|
|
|
|
\ 'dartanalyzer',
|
|
|
|
\ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
|
|
|
|
AssertEqual
|
2017-10-26 18:31:07 -04:00
|
|
|
\ ale#Escape('dartanalyzer') . ' %s',
|
2017-07-18 18:57:33 -04:00
|
|
|
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The executable should be configurable):
|
|
|
|
let g:ale_dart_dartanalyzer_executable = '/usr/lib/dart/bin/dartanalyzer'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ '/usr/lib/dart/bin/dartanalyzer',
|
|
|
|
\ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
|
|
|
|
AssertEqual
|
2017-10-26 18:31:07 -04:00
|
|
|
\ ale#Escape('/usr/lib/dart/bin/dartanalyzer') . ' %s',
|
2017-07-18 18:57:33 -04:00
|
|
|
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The .packages file should be set if detected):
|
|
|
|
call ale#test#SetFilename('dart_paths/foo')
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#Escape('dartanalyzer')
|
2017-10-22 20:26:31 -04:00
|
|
|
\ . ' --packages ' . ale#Escape(ale#path#Winify(g:dir . '/dart_paths/.packages'))
|
2017-10-26 18:31:07 -04:00
|
|
|
\ . ' %s',
|
2017-07-18 18:57:33 -04:00
|
|
|
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|