summaryrefslogtreecommitdiff
path: root/test/test_no_linting_on_write_quit.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-02-06 22:00:11 +0000
committerw0rp <devw0rp@gmail.com>2019-02-06 22:00:11 +0000
commit81c73da3b98455c4ad11f32208dac3dcfa6e0da7 (patch)
tree4b52d8ceb590c51c7a6facf11dd638f1614502a9 /test/test_no_linting_on_write_quit.vader
parent3e11cbd18da3852fab5dee3f743bc60dc87f0775 (diff)
downloadale-81c73da3b98455c4ad11f32208dac3dcfa6e0da7.zip
#2132 - lint and fix with ale#command#Run
A new function is added here which will later be modified for public use in linter and fixer callbacks. All linting and fixing now goes through this new function, to prove that it works in all cases.
Diffstat (limited to 'test/test_no_linting_on_write_quit.vader')
-rw-r--r--test/test_no_linting_on_write_quit.vader8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_no_linting_on_write_quit.vader b/test/test_no_linting_on_write_quit.vader
index 75de06a4..7ad08d08 100644
--- a/test/test_no_linting_on_write_quit.vader
+++ b/test/test_no_linting_on_write_quit.vader
@@ -58,6 +58,7 @@ Execute(No linting should be done on :wq or :x):
" First try just the SaveEvent, to be sure that we set errors in the test.
call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
@@ -65,6 +66,7 @@ Execute(No linting should be done on :wq or :x):
call setloclist(0, [])
call ale#events#QuitEvent(bufnr(''))
call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
AssertEqual [], ale#test#GetLoclistWithoutModule()
@@ -73,11 +75,13 @@ Execute(No linting should be for :w after :q fails):
let g:ale_fix_on_save = 0
call ale#events#QuitEvent(bufnr(''))
+ call ale#test#FlushJobs()
" Simulate 2 seconds passing.
let b:ale_quitting -= 1000
call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
@@ -86,6 +90,7 @@ Execute(No linting should be done on :wq or :x after fixing files):
let g:ale_fix_on_save = 1
call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())
@@ -93,6 +98,7 @@ Execute(No linting should be done on :wq or :x after fixing files):
call setloclist(0, [])
call ale#events#QuitEvent(bufnr(''))
call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
AssertEqual [], ale#test#GetLoclistWithoutModule()
@@ -101,10 +107,12 @@ Execute(Linting should be done after :q fails and fixing files):
let g:ale_fix_on_save = 1
call ale#events#QuitEvent(bufnr(''))
+ call ale#test#FlushJobs()
" Simulate 2 seconds passing.
let b:ale_quitting -= 1000
call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
AssertEqual 1, len(ale#test#GetLoclistWithoutModule())