summaryrefslogtreecommitdiff
path: root/test/smoke_test.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-07 23:12:45 +0100
committerw0rp <devw0rp@gmail.com>2017-06-08 17:30:21 +0100
commit62862c334776e3138f5a5456ed41bb146969b2c2 (patch)
treef016f7d18db2f1dc6d6a864152b1221af7a86eee /test/smoke_test.vader
parent8ce6d47ef6f2153b702f3f774910ad7747ced185 (diff)
downloadale-62862c334776e3138f5a5456ed41bb146969b2c2.zip
Experimental code for showing results as soon as each linter completes
Diffstat (limited to 'test/smoke_test.vader')
-rw-r--r--test/smoke_test.vader40
1 files changed, 36 insertions, 4 deletions
diff --git a/test/smoke_test.vader b/test/smoke_test.vader
index 30f32534..209b5bb2 100644
--- a/test/smoke_test.vader
+++ b/test/smoke_test.vader
@@ -1,13 +1,16 @@
Before:
function! TestCallback(buffer, output)
return [{
- \ 'bufnr': a:buffer,
\ 'lnum': 2,
- \ 'vcol': 0,
\ 'col': 3,
\ 'text': a:output[0],
- \ 'type': 'E',
- \ 'nr': -1,
+ \}]
+ endfunction
+ function! TestCallback2(buffer, output)
+ return [{
+ \ 'lnum': 3,
+ \ 'col': 4,
+ \ 'text': a:output[0],
\}]
endfunction
@@ -22,6 +25,7 @@ Before:
After:
let g:ale_buffer_info = {}
delfunction TestCallback
+ delfunction TestCallback2
call ale#linter#Reset()
Given foobar (Some imaginary filetype):
@@ -46,3 +50,31 @@ Execute(Linters should run with the default options):
\ 'pattern': '',
\ 'valid': 1,
\ }], getloclist(0)
+
+Execute(Previous errors should be removed when linters change):
+ call ale#Lint()
+ call ale#engine#WaitForJobs(2000)
+
+ call ale#linter#Reset()
+
+ call ale#linter#Define('foobar', {
+ \ 'name': 'testlinter2',
+ \ 'callback': 'TestCallback2',
+ \ 'executable': 'echo',
+ \ 'command': '/bin/sh -c ''echo baz boz''',
+ \})
+
+ call ale#Lint()
+ call ale#engine#WaitForJobs(2000)
+
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 3,
+ \ 'vcol': 0,
+ \ 'col': 4,
+ \ 'text': 'baz boz',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \ }], getloclist(0)