summaryrefslogtreecommitdiff
path: root/test/test_lint_file_linters.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-31 22:36:30 +0100
committerw0rp <devw0rp@gmail.com>2017-07-31 22:36:30 +0100
commitec82530247547a696f888cdefd4aeec5cf3d40cf (patch)
tree50f5819e291200cfeabf68b614c0e49ac8544e46 /test/test_lint_file_linters.vader
parent7c32ef104bea322114e9c2bcfbd939aa22ee00af (diff)
downloadale-ec82530247547a696f888cdefd4aeec5cf3d40cf.zip
#734 - Do not clear file linter results when no buffers are run
Diffstat (limited to 'test/test_lint_file_linters.vader')
-rw-r--r--test/test_lint_file_linters.vader51
1 files changed, 43 insertions, 8 deletions
diff --git a/test/test_lint_file_linters.vader b/test/test_lint_file_linters.vader
index b0dc1eb3..a82db727 100644
--- a/test/test_lint_file_linters.vader
+++ b/test/test_lint_file_linters.vader
@@ -1,6 +1,11 @@
Before:
Save g:ale_run_synchronously
+ Save g:ale_buffer_info
+ Save g:ale_linters
+
+ let g:ale_buffer_info = {}
let g:ale_run_synchronously = 1
+ call ale#ResetLintFileMarkers()
let g:buffer_result = [
\ {
@@ -95,8 +100,6 @@ Given foobar (Some imaginary filetype):
baz
Execute(Running linters without 'lint_file' should run only buffer linters):
- call ale#ResetLintFileMarkers()
- let g:ale_buffer_info = {}
call ale#Queue(0)
AssertEqual [
@@ -115,9 +118,6 @@ Execute(Running linters without 'lint_file' should run only buffer linters):
\], GetSimplerLoclist()
Execute(Running linters with 'lint_file' should run all linters):
- call ale#ResetLintFileMarkers()
- let g:ale_buffer_info = {}
-
Assert filereadable(expand('%:p')), 'The file was not readable'
call ale#Queue(0, 'lint_file')
@@ -150,9 +150,6 @@ Execute(Running linters with 'lint_file' should run all linters):
\], GetSimplerLoclist()
Execute(Linter errors from files should be kept):
- call ale#ResetLintFileMarkers()
- let g:ale_buffer_info = {}
-
Assert filereadable(expand('%:p')), 'The file was not readable'
call ale#Queue(0, 'lint_file')
@@ -189,3 +186,41 @@ Execute(Linter errors from files should be kept):
\ 'type': 'E',
\ },
\], GetSimplerLoclist()
+
+Execute(Linter errors from files should be kept when no other linters are run):
+ let g:ale_linters = {'foobar': ['lint_file_linter']}
+ Assert filereadable(expand('%:p')), 'The file was not readable'
+
+ call ale#Queue(0, 'lint_file')
+
+ AssertEqual [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 3,
+ \ 'text': 'file warning',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 3,
+ \ 'text': 'file error',
+ \ 'type': 'E',
+ \ },
+ \], GetSimplerLoclist()
+
+ call ale#Queue(0)
+
+ AssertEqual [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 3,
+ \ 'text': 'file warning',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 3,
+ \ 'text': 'file error',
+ \ 'type': 'E',
+ \ },
+ \], GetSimplerLoclist()