summaryrefslogtreecommitdiff
path: root/test/test_lint_file_linters.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-30 22:19:57 +0000
committerw0rp <devw0rp@gmail.com>2017-10-30 22:19:57 +0000
commit50f7ad35529e0672e4161e3c74be5cb87196a2f1 (patch)
tree3feeaa166f4a52a5cb4962cb890622168ba50547 /test/test_lint_file_linters.vader
parent1575b3d7ddc5c2844d987f2abb0a5defe493972b (diff)
downloadale-50f7ad35529e0672e4161e3c74be5cb87196a2f1.zip
#857 - Add b:ale_fix_on_save for controlling fixing on save for specific buffers
Diffstat (limited to 'test/test_lint_file_linters.vader')
-rw-r--r--test/test_lint_file_linters.vader15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test_lint_file_linters.vader b/test/test_lint_file_linters.vader
index bea8c3f0..2e992e13 100644
--- a/test/test_lint_file_linters.vader
+++ b/test/test_lint_file_linters.vader
@@ -1,4 +1,6 @@
Before:
+ Save g:ale_fix_on_save
+ Save g:ale_enabled
Save g:ale_run_synchronously
Save g:ale_set_lists_synchronously
Save g:ale_buffer_info
@@ -7,6 +9,7 @@ Before:
let g:ale_buffer_info = {}
let g:ale_run_synchronously = 1
let g:ale_set_lists_synchronously = 1
+ let b:ale_save_event_fired = 0
call ale#ResetLintFileMarkers()
let g:buffer_result = [
@@ -261,7 +264,10 @@ Execute(The Save event should respect the buffer number):
\], GetSimplerLoclist()
Execute(The Save event should set b:ale_save_event_fired to 1):
- let b:ale_enabled = 0
+ let g:ale_lint_on_save = 1
+ let b:ale_enabled = 1
+
+ call ale#linter#Reset()
call ale#events#SaveEvent(bufnr(''))
" This flag needs to be set so windows can be opened, etc.
@@ -289,3 +295,10 @@ Execute(lint_file linters should stay running after checking without them):
AssertEqual 2, len(g:ale_buffer_info[bufnr('')].job_list)
call ale#engine#WaitForJobs(2000)
+
+Execute(The save event should not lint the buffer when ALE is disabled):
+ let g:ale_enabled = 0
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual [], GetSimplerLoclist()
+ AssertEqual 0, b:ale_save_event_fired