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.
2 Save g:ale_command_wrapper
4 let g:ale_command_wrapper = ''
6 function! TestCommand(expected_part, input) abort
7 let l:expected = has('win32')
8 \ ? 'cmd /s/c "' . a:expected_part . '"'
9 \ : split(&shell) + split(&shellcmdflag) + [a:expected_part]
11 AssertEqual l:expected, ale#job#PrepareCommand(bufnr(''), a:input)
17 unlet! b:ale_command_wrapper
19 delfunction TestCommand
21 Execute(The command wrapper should work with a nice command):
22 let b:ale_command_wrapper = 'nice -n 5'
24 call TestCommand('nice -n 5 foo bar', 'foo bar')
26 Execute(The command wrapper should spread arguments correctly):
27 let b:ale_command_wrapper = 'wrap %* --'
29 call TestCommand('wrap foo bar --', 'foo bar')
31 Execute(Wrappers with the command as one argument should be supported):
32 let b:ale_command_wrapper = 'wrap -c %@ -x'
34 call TestCommand('wrap -c ' . ale#Escape('foo bar') . ' -x', 'foo bar')
36 Execute(&& and ; should be moved to the front):
37 let b:ale_command_wrapper = 'wrap -c %@ -x'
39 call TestCommand('foo && bar; wrap -c ' . ale#Escape('baz') . ' -x', 'foo && bar;baz')
41 let b:ale_command_wrapper = 'nice -n 5'
43 call TestCommand('foo && bar; nice -n 5 baz -z', 'foo && bar;baz -z')