]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/test_deferred_executable_string.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / test_deferred_executable_string.vader
1 Before:
2   Save g:ale_run_synchronously
3   Save g:ale_emulate_job_failure
4   Save g:ale_buffer_info
5
6   let g:ale_run_synchronously = 1
7   let g:ale_buffer_info = {}
8   let b:ale_history = []
9
10   call ale#linter#Reset()
11   call ale#assert#SetUpLinterTestCommands()
12   call ale#linter#Define('foobar', {
13   \ 'name': 'lint_file_linter',
14   \ 'callback': 'LintFileCallback',
15   \ 'executable': {b -> ale#command#Run(b, 'echo', {-> ale#command#Run(b, 'echo', {-> 'foo'})})},
16   \ 'command': 'echo',
17   \ 'read_buffer': 0,
18   \})
19
20 After:
21   Restore
22
23   call ale#assert#TearDownLinterTest()
24
25 Given foobar (Some imaginary filetype):
26 Execute(It should be possible to compute an executable to check based on the result of commands):
27   AssertLinter 'foo', 'echo'
28
29   ALELint
30   call ale#test#FlushJobs()
31
32   AssertEqual
33   \ [{'status': 0, 'job_id': 'executable', 'command': 'foo'}],
34   \ filter(copy(b:ale_history), 'v:val.job_id is# ''executable''')
35
36 Execute(We should handle the deferered executable command failing):
37   let g:ale_emulate_job_failure = 1
38
39   AssertLinter 0, 'echo'
40
41   ALELint
42   call ale#test#FlushJobs()
43
44   AssertEqual
45   \ [],
46   \ filter(copy(b:ale_history), 'v:val.job_id is# ''executable''')