]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/test_deferred_command_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:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / test_deferred_command_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': has('win32') ? 'cmd' : 'echo',
16   \ 'command': {b -> ale#command#Run(b, 'echo', {-> ale#command#Run(b, 'echo', {-> 'foo'})})},
17   \ 'read_buffer': 0,
18   \})
19
20   " Run the test commands in the shell.
21   let g:ale_run_synchronously_emulate_commands = 0
22
23 After:
24   Restore
25
26   call ale#assert#TearDownLinterTest()
27   unlet! g:ale_run_synchronously_callbacks
28
29 Given foobar (Some imaginary filetype):
30 Execute(It should be possible to compute a command based on the result of other commands):
31   AssertLinter has('win32') ? 'cmd' : 'echo', 'foo'
32
33   ALELint
34   call ale#test#FlushJobs()
35
36   AssertEqual
37   \ 1,
38   \ len(filter(copy(b:ale_history), 'string(v:val.command) =~# ''foo'''))
39
40 Execute(We should handle the deferered command failing):
41   let g:ale_emulate_job_failure = 1
42
43   AssertLinter has('win32') ? 'cmd' : 'echo', 0
44
45   ALELint
46   call ale#test#FlushJobs()
47
48   AssertEqual
49   \ 0,
50   \ len(filter(copy(b:ale_history), 'string(v:val.command) =~# ''foo'''))