diff options
author | w0rp <devw0rp@gmail.com> | 2019-02-12 18:05:33 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2019-02-12 18:05:33 +0000 |
commit | 926ad47a49d74c910c610d4a9cedd5c4838d679d (patch) | |
tree | 9f86511f8854e9965978092fcb233a34e3516440 /test/test_deferred_executable_string.vader | |
parent | bf196ba17c9e261e4e3a9dba64260c6d0b2c8af9 (diff) | |
download | ale-926ad47a49d74c910c610d4a9cedd5c4838d679d.zip |
#2132 - Implement deferred executable string handling for linters
Diffstat (limited to 'test/test_deferred_executable_string.vader')
-rw-r--r-- | test/test_deferred_executable_string.vader | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_deferred_executable_string.vader b/test/test_deferred_executable_string.vader new file mode 100644 index 00000000..65582f1f --- /dev/null +++ b/test/test_deferred_executable_string.vader @@ -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''') |