From 1c5253b928cae4d97351b3b7050e3e0b6242b229 Mon Sep 17 00:00:00 2001 From: w0rp Date: Fri, 8 Sep 2017 21:38:51 +0100 Subject: [PATCH] Fix the smoke_test.vader file on Windows --- test/smoke_test.vader | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/test/smoke_test.vader b/test/smoke_test.vader index 209b5bb..7635cbd 100644 --- a/test/smoke_test.vader +++ b/test/smoke_test.vader @@ -1,16 +1,23 @@ 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) + " Windows adds extra spaces to the text from echo. return [{ \ 'lnum': 2, \ 'col': 3, - \ 'text': a:output[0], + \ 'text': substitute(a:output[0], ' *$', '', ''), \}] endfunction function! TestCallback2(buffer, output) return [{ \ 'lnum': 3, \ 'col': 4, - \ 'text': a:output[0], + \ 'text': substitute(a:output[0], ' *$', '', ''), \}] endfunction @@ -18,12 +25,13 @@ Before: call ale#linter#Define('foobar', { \ 'name': 'testlinter', \ 'callback': 'TestCallback', - \ 'executable': 'echo', - \ 'command': '/bin/sh -c ''echo foo bar''', + \ 'executable': has('win32') ? 'cmd' : 'echo', + \ 'command': has('win32') ? 'echo foo bar' : '/bin/sh -c ''echo foo bar''', \}) After: - let g:ale_buffer_info = {} + Restore + delfunction TestCallback delfunction TestCallback2 call ale#linter#Reset() @@ -60,8 +68,8 @@ Execute(Previous errors should be removed when linters change): call ale#linter#Define('foobar', { \ 'name': 'testlinter2', \ 'callback': 'TestCallback2', - \ 'executable': 'echo', - \ 'command': '/bin/sh -c ''echo baz boz''', + \ 'executable': has('win32') ? 'cmd' : 'echo', + \ 'command': has('win32') ? 'echo baz boz' : '/bin/sh -c ''echo baz boz''', \}) call ale#Lint()