Test that we CleanupEveryBuffer when vim supports it

This commit is contained in:
Felipe Sere 2018-09-17 21:26:25 +01:00
parent cbf0568061
commit f09e6d638f
No known key found for this signature in database
GPG key ID: B12F040F934D78D0

View file

@ -175,10 +175,19 @@ Execute (g:ale_lint_on_filetype_changed = 1 should bind the FileType event):
\ filter(CheckAutocmd('ALEEvents'), 'v:val =~ ''\v^FileType''')
Execute (ALECleanupGroup should include the right commands):
AssertEqual [
\ 'BufDelete * if exists(''*ale#engine#Cleanup'') | call ale#engine#Cleanup(str2nr(expand(''<abuf>''))) | endif',
\ 'QuitPre * call ale#events#QuitEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALECleanupGroup')
if exists('##VimSuspend')
AssertEqual [
\ 'BufDelete * if exists(''*ale#engine#Cleanup'') | call ale#engine#Cleanup(str2nr(expand(''<abuf>''))) | endif',
\ 'QuitPre * call ale#events#QuitEvent(str2nr(expand(''<abuf>'')))',
\ 'VimSuspend * if exists(''*ale#engine#CleanupEveryBuffer'') | call ale#engine#CleanupEveryBuffer() | endif',
\], CheckAutocmd('ALECleanupGroup')
else
AssertEqual [
\ 'BufDelete * if exists(''*ale#engine#Cleanup'') | call ale#engine#Cleanup(str2nr(expand(''<abuf>''))) | endif',
\ 'QuitPre * call ale#events#QuitEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALECleanupGroup')
endif
Execute(Enabling completion should set up autocmd events correctly):
let g:ale_completion_enabled = 0