From a01fab2ee6dd827d555792f69fc30443a64dac5f Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 17 Jul 2018 00:18:20 +0100 Subject: Fix #1619 - Rewrite lint on enter events so they behave better --- test/test_checkingbuffer_autocmd.vader | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/test_checkingbuffer_autocmd.vader') diff --git a/test/test_checkingbuffer_autocmd.vader b/test/test_checkingbuffer_autocmd.vader index 1cbfa342..9e3a8188 100644 --- a/test/test_checkingbuffer_autocmd.vader +++ b/test/test_checkingbuffer_autocmd.vader @@ -1,9 +1,7 @@ -Given testft (An empty file): - Before: Save g:ale_run_synchronously Save g:ale_buffer_info - + let g:ale_run_synchronously = 1 let g:ale_buffer_info = {} @@ -15,6 +13,7 @@ Before: return [] endfunction + call ale#linter#PreventLoading('testft') call ale#linter#Define('testft', { \ 'name': 'testlinter', \ 'callback': 'TestCallback', @@ -26,32 +25,33 @@ After: Restore unlet! g:checking_buffer - + delfunction TestCallback call ale#linter#Reset() - + augroup VaderTest autocmd! augroup end augroup! VaderTest +Given testft (An empty file): Execute(ALELintPre should not return success on ale#engine#IsCheckingBuffer): augroup VaderTest autocmd! - autocmd User ALELintPre let g:checking_buffer = ale#engine#IsCheckingBuffer(bufnr('')) ? 1 : 0 + autocmd User ALELintPre let g:checking_buffer = ale#engine#IsCheckingBuffer(bufnr('')) ? 1 : 0 augroup end - call ale#Lint() + ALELint AssertEqual g:checking_buffer, 0 Execute(ALEJobStarted should return success on ale#engine#IsCheckingBuffer): augroup VaderTest autocmd! - autocmd User ALEJobStarted let g:checking_buffer = ale#engine#IsCheckingBuffer(bufnr('')) ? 1 : 0 + autocmd User ALEJobStarted let g:checking_buffer = ale#engine#IsCheckingBuffer(bufnr('')) ? 1 : 0 augroup end - call ale#Lint() + ALELint AssertEqual g:checking_buffer, 1 -- cgit v1.2.3