You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
661 B
Plaintext
36 lines
661 B
Plaintext
7 years ago
|
Before:
|
||
|
let g:output = []
|
||
|
|
||
|
function! TestCallback(buffer, output)
|
||
|
let g:output = a:output
|
||
|
|
||
|
return []
|
||
|
endfunction
|
||
|
|
||
|
call ale#linter#Define('foobar', {
|
||
|
\ 'name': 'testlinter',
|
||
|
\ 'callback': 'TestCallback',
|
||
|
\ 'executable': 'cat',
|
||
|
\ 'command': 'cat %t',
|
||
|
\})
|
||
|
|
||
|
After:
|
||
|
unlet! g:output
|
||
|
delfunction TestCallback
|
||
|
call ale#linter#Reset()
|
||
|
|
||
|
Given foobar (Some imaginary filetype):
|
||
|
foo
|
||
|
bar
|
||
|
baz
|
||
|
|
||
|
Execute(ALE should be able to read the %t file):
|
||
|
AssertEqual 'foobar', &filetype
|
||
|
|
||
|
" Sleep a little so the test passes more.
|
||
|
sleep 100ms
|
||
|
call ale#Lint()
|
||
|
call ale#engine#WaitForJobs(2000)
|
||
|
|
||
|
AssertEqual ['foo', 'bar', 'baz'], g:output
|