summaryrefslogtreecommitdiff
path: root/test/test_ale_lint_command.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-15 18:24:53 +0100
committerw0rp <devw0rp@gmail.com>2018-07-15 18:28:28 +0100
commita42999a639b2916b769a85f37d037be314d9d61b (patch)
tree5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/test_ale_lint_command.vader
parent5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff)
downloadale-a42999a639b2916b769a85f37d037be314d9d61b.zip
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/test_ale_lint_command.vader')
-rw-r--r--test/test_ale_lint_command.vader22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/test_ale_lint_command.vader b/test/test_ale_lint_command.vader
index 15f1f054..6434e45f 100644
--- a/test/test_ale_lint_command.vader
+++ b/test/test_ale_lint_command.vader
@@ -38,6 +38,7 @@ After:
Restore
unlet! g:expected_loclist
+ unlet! b:i
call ale#engine#Cleanup(bufnr(''))
call ale#linter#Reset()
@@ -54,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 getloclist(0) == g:expected_loclist
+ break
+ endif
+ endfor
" Check the loclist
AssertEqual g:expected_loclist, getloclist(0)