From f09e6d638fc012b3bdccccdc3496e135fbd7df87 Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Mon, 17 Sep 2018 21:26:25 +0100 Subject: Test that we CleanupEveryBuffer when vim supports it --- test/test_autocmd_commands.vader | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/test_autocmd_commands.vader b/test/test_autocmd_commands.vader index 8d5048f0..4bb894ba 100644 --- a/test/test_autocmd_commands.vader +++ b/test/test_autocmd_commands.vader @@ -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(''''))) | endif', - \ 'QuitPre * call ale#events#QuitEvent(str2nr(expand('''')))', - \], CheckAutocmd('ALECleanupGroup') + if exists('##VimSuspend') + AssertEqual [ + \ 'BufDelete * if exists(''*ale#engine#Cleanup'') | call ale#engine#Cleanup(str2nr(expand(''''))) | endif', + \ 'QuitPre * call ale#events#QuitEvent(str2nr(expand('''')))', + \ '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(''''))) | endif', + \ 'QuitPre * call ale#events#QuitEvent(str2nr(expand('''')))', + \], CheckAutocmd('ALECleanupGroup') + endif + Execute(Enabling completion should set up autocmd events correctly): let g:ale_completion_enabled = 0 -- cgit v1.2.3