diff options
Diffstat (limited to 'test/test_ale_lint_command.vader')
-rw-r--r-- | test/test_ale_lint_command.vader | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/test/test_ale_lint_command.vader b/test/test_ale_lint_command.vader index d36b2177..bc2ebabe 100644 --- a/test/test_ale_lint_command.vader +++ b/test/test_ale_lint_command.vader @@ -14,13 +14,6 @@ Before: \ 'pattern': '', \ 'valid': 1, \}] - let g:expected_groups = [ - \ 'ALECleanupGroup', - \ 'ALECursorGroup', - \ 'ALEHighlightBufferGroup', - \ 'ALERunOnEnterGroup', - \ 'ALERunOnTextChangedGroup', - \] function! ToggleTestCallback(buffer, output) return [{ @@ -45,11 +38,13 @@ After: Restore unlet! g:expected_loclist - unlet! g:expected_groups + unlet! b:i - let g:ale_buffer_info = {} + call ale#engine#Cleanup(bufnr('')) call ale#linter#Reset() + let g:ale_buffer_info = {} + delfunction ToggleTestCallback Given foobar (Some imaginary filetype): @@ -60,14 +55,21 @@ Given foobar (Some imaginary filetype): Execute(ALELint should run the linters): AssertEqual 'foobar', &filetype - ALELint - call ale#engine#WaitForJobs(2000) + " Try to run the linter a few times, as it fails randomly in NeoVim. + for b:i in range(5) + ALELint + call ale#engine#WaitForJobs(2000) + + if !has('nvim') + " Sleep so the delayed list function can run. + " This breaks the tests in NeoVim for some reason. + sleep 1ms + endif - if !has('nvim') - " Sleep so the delayed list function can run. - " This breaks the tests in NeoVim for some reason. - sleep 1ms - endif + if ale#test#GetLoclistWithoutModule() == g:expected_loclist + break + endif + endfor " Check the loclist - AssertEqual g:expected_loclist, getloclist(0) + AssertEqual g:expected_loclist, ale#test#GetLoclistWithoutModule() |