Fix the smoke_test.vader file on Windows

This commit is contained in:
w0rp 2017-09-08 21:38:51 +01:00
parent 89cc8ca314
commit 1c5253b928

View File

@ -1,16 +1,23 @@
Before: Before:
Save g:ale_set_lists_synchronously
Save g:ale_buffer_info
let g:ale_buffer_info = {}
let g:ale_set_lists_synchronously = 1
function! TestCallback(buffer, output) function! TestCallback(buffer, output)
" Windows adds extra spaces to the text from echo.
return [{ return [{
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 3, \ 'col': 3,
\ 'text': a:output[0], \ 'text': substitute(a:output[0], ' *$', '', ''),
\}] \}]
endfunction endfunction
function! TestCallback2(buffer, output) function! TestCallback2(buffer, output)
return [{ return [{
\ 'lnum': 3, \ 'lnum': 3,
\ 'col': 4, \ 'col': 4,
\ 'text': a:output[0], \ 'text': substitute(a:output[0], ' *$', '', ''),
\}] \}]
endfunction endfunction
@ -18,12 +25,13 @@ Before:
call ale#linter#Define('foobar', { call ale#linter#Define('foobar', {
\ 'name': 'testlinter', \ 'name': 'testlinter',
\ 'callback': 'TestCallback', \ 'callback': 'TestCallback',
\ 'executable': 'echo', \ 'executable': has('win32') ? 'cmd' : 'echo',
\ 'command': '/bin/sh -c ''echo foo bar''', \ 'command': has('win32') ? 'echo foo bar' : '/bin/sh -c ''echo foo bar''',
\}) \})
After: After:
let g:ale_buffer_info = {} Restore
delfunction TestCallback delfunction TestCallback
delfunction TestCallback2 delfunction TestCallback2
call ale#linter#Reset() call ale#linter#Reset()
@ -60,8 +68,8 @@ Execute(Previous errors should be removed when linters change):
call ale#linter#Define('foobar', { call ale#linter#Define('foobar', {
\ 'name': 'testlinter2', \ 'name': 'testlinter2',
\ 'callback': 'TestCallback2', \ 'callback': 'TestCallback2',
\ 'executable': 'echo', \ 'executable': has('win32') ? 'cmd' : 'echo',
\ 'command': '/bin/sh -c ''echo baz boz''', \ 'command': has('win32') ? 'echo baz boz' : '/bin/sh -c ''echo baz boz''',
\}) \})
call ale#Lint() call ale#Lint()