Run the lint_file checks synchronously, so the tests will consistently pass

This commit is contained in:
w0rp 2017-04-30 10:09:26 +01:00
parent a6cadaabef
commit 6547adcf2f

View File

@ -1,4 +1,7 @@
Before: Before:
Save g:ale_run_synchronously
let g:ale_run_synchronously = 1
let g:buffer_result = [ let g:buffer_result = [
\ { \ {
\ 'lnum': 1, \ 'lnum': 1,
@ -67,6 +70,8 @@ Before:
\}) \})
After: After:
Restore
unlet g:buffer_result unlet g:buffer_result
let g:ale_buffer_info = {} let g:ale_buffer_info = {}
call ale#linter#Reset() call ale#linter#Reset()
@ -83,7 +88,6 @@ Execute(Running linters without 'lint_file' should run only buffer linters):
call ale#ResetLintFileMarkers() call ale#ResetLintFileMarkers()
let g:ale_buffer_info = {} let g:ale_buffer_info = {}
call ale#Queue(0) call ale#Queue(0)
call ale#engine#WaitForJobs(2000)
AssertEqual [ AssertEqual [
\ { \ {
@ -104,7 +108,6 @@ Execute(Running linters with 'lint_file' should run all linters):
call ale#ResetLintFileMarkers() call ale#ResetLintFileMarkers()
let g:ale_buffer_info = {} let g:ale_buffer_info = {}
call ale#Queue(0, 'lint_file') call ale#Queue(0, 'lint_file')
call ale#engine#WaitForJobs(2000)
AssertEqual [ AssertEqual [
\ { \ {
@ -137,7 +140,6 @@ Execute(Linter errors from files should be kept):
call ale#ResetLintFileMarkers() call ale#ResetLintFileMarkers()
let g:ale_buffer_info = {} let g:ale_buffer_info = {}
call ale#Queue(0, 'lint_file') call ale#Queue(0, 'lint_file')
call ale#engine#WaitForJobs(2000)
" Change the results for the buffer callback. " Change the results for the buffer callback.
let g:buffer_result = [ let g:buffer_result = [
@ -150,7 +152,6 @@ Execute(Linter errors from files should be kept):
\] \]
call ale#Queue(0) call ale#Queue(0)
call ale#engine#WaitForJobs(2000)
AssertEqual [ AssertEqual [
\ { \ {