2019-02-12 18:05:33 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_run_synchronously
|
2019-02-21 21:24:41 +00:00
|
|
|
Save g:ale_emulate_job_failure
|
2019-02-15 16:40:01 +00:00
|
|
|
Save g:ale_buffer_info
|
2019-02-12 18:05:33 +00:00
|
|
|
|
|
|
|
let g:ale_run_synchronously = 1
|
2019-02-15 16:40:01 +00:00
|
|
|
let g:ale_buffer_info = {}
|
2019-02-21 21:24:41 +00:00
|
|
|
let b:ale_history = []
|
2019-02-12 18:05:33 +00:00
|
|
|
|
|
|
|
call ale#linter#Reset()
|
|
|
|
call ale#assert#SetUpLinterTestCommands()
|
|
|
|
call ale#linter#Define('foobar', {
|
|
|
|
\ 'name': 'lint_file_linter',
|
|
|
|
\ 'callback': 'LintFileCallback',
|
|
|
|
\ 'executable': {b -> ale#command#Run(b, 'echo', {-> ale#command#Run(b, 'echo', {-> 'foo'})})},
|
|
|
|
\ 'command': 'echo',
|
|
|
|
\ 'read_buffer': 0,
|
|
|
|
\})
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Given foobar (Some imaginary filetype):
|
|
|
|
Execute(It should be possible to compute an executable to check based on the result of commands):
|
|
|
|
AssertLinter 'foo', 'echo'
|
|
|
|
|
|
|
|
ALELint
|
|
|
|
call ale#test#FlushJobs()
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [{'status': 0, 'job_id': 'executable', 'command': 'foo'}],
|
|
|
|
\ filter(copy(b:ale_history), 'v:val.job_id is# ''executable''')
|
2019-02-21 21:24:41 +00:00
|
|
|
|
2023-09-08 00:00:35 +00:00
|
|
|
Execute(We should handle the deferered executable command failing):
|
2019-02-21 21:24:41 +00:00
|
|
|
let g:ale_emulate_job_failure = 1
|
|
|
|
|
|
|
|
AssertLinter 0, 'echo'
|
|
|
|
|
|
|
|
ALELint
|
|
|
|
call ale#test#FlushJobs()
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [],
|
|
|
|
\ filter(copy(b:ale_history), 'v:val.job_id is# ''executable''')
|