summaryrefslogtreecommitdiff
path: root/test/smoke_test.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-09-08 21:38:51 +0100
committerw0rp <devw0rp@gmail.com>2017-09-08 21:38:51 +0100
commit1c5253b928cae4d97351b3b7050e3e0b6242b229 (patch)
tree3202676571e70d7b50d890b9ae60827151fef604 /test/smoke_test.vader
parent89cc8ca31485b986fe9f7139afe77712b89cca11 (diff)
downloadale-1c5253b928cae4d97351b3b7050e3e0b6242b229.zip
Fix the smoke_test.vader file on Windows
Diffstat (limited to 'test/smoke_test.vader')
-rw-r--r--test/smoke_test.vader22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/smoke_test.vader b/test/smoke_test.vader
index 209b5bb2..7635cbd9 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()