mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
#2132 - Implement deferred executable string handling for linters
This commit is contained in:
32
test/test_deferred_executable_string.vader
Normal file
32
test/test_deferred_executable_string.vader
Normal file
@@ -0,0 +1,32 @@
|
||||
Before:
|
||||
Save g:ale_run_synchronously
|
||||
|
||||
let g:ale_run_synchronously = 1
|
||||
|
||||
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):
|
||||
let b:ale_history = []
|
||||
|
||||
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''')
|
||||
Reference in New Issue
Block a user