summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-06-10 20:54:38 +0100
committerw0rp <devw0rp@gmail.com>2019-06-10 20:54:38 +0100
commit168768b32667b244e0afdc8da851d91ab95d6e2f (patch)
tree61c022da7b2584ac9b4a405ba201ed01200dd99d /test
parent8b46fa3ee716485b4dd7c3f86c9302a140be6bfa (diff)
downloadale-168768b32667b244e0afdc8da851d91ab95d6e2f.zip
Lint on InsertLeave, not in insert mode by default
b:ale_lint_on_insert_leave is now supported as tests need it. These defaults are saner and cause fewer issues for users by default.
Diffstat (limited to 'test')
-rw-r--r--test/test_ale_info.vader8
-rw-r--r--test/test_autocmd_commands.vader4
-rw-r--r--test/test_cursor_warnings.vader9
3 files changed, 15 insertions, 6 deletions
diff --git a/test/test_ale_info.vader b/test/test_ale_info.vader
index c723dba3..decd49e9 100644
--- a/test/test_ale_info.vader
+++ b/test/test_ale_info.vader
@@ -31,8 +31,8 @@ Before:
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = 50
let g:ale_history_log_output = 1
- let g:ale_lint_on_insert_leave = 0
- let g:ale_lint_on_text_changed = 'always'
+ let g:ale_lint_on_insert_leave = 1
+ let g:ale_lint_on_text_changed = 'normal'
let g:ale_lsp_error_messages = {}
let g:ale_maximum_file_size = 0
let g:ale_pattern_options = {}
@@ -88,9 +88,9 @@ Before:
\ 'let g:ale_lint_delay = 200',
\ 'let g:ale_lint_on_enter = 1',
\ 'let g:ale_lint_on_filetype_changed = 1',
- \ 'let g:ale_lint_on_insert_leave = 0',
+ \ 'let g:ale_lint_on_insert_leave = 1',
\ 'let g:ale_lint_on_save = 1',
- \ 'let g:ale_lint_on_text_changed = ''always''',
+ \ 'let g:ale_lint_on_text_changed = ''normal''',
\ 'let g:ale_linter_aliases = {}',
\ 'let g:ale_linters = {}',
\ 'let g:ale_linters_explicit = 0',
diff --git a/test/test_autocmd_commands.vader b/test/test_autocmd_commands.vader
index 4bb894ba..241e7d3e 100644
--- a/test/test_autocmd_commands.vader
+++ b/test/test_autocmd_commands.vader
@@ -87,7 +87,7 @@ Execute (All events should be set up when everything is on):
\ 'CursorMoved * if exists(''*ale#engine#Cleanup'') | call ale#cursor#EchoCursorWarningWithDelay() | endif',
\ 'FileChangedShellPost * call ale#events#FileChangedEvent(str2nr(expand(''<abuf>'')))',
\ 'FileType * call ale#events#FileTypeEvent( str2nr(expand(''<abuf>'')), expand(''<amatch>''))',
- \ 'InsertLeave * call ale#Queue(0)',
+ \ 'InsertLeave * if ale#Var(str2nr(expand(''<abuf>'')), ''lint_on_insert_leave'') | call ale#Queue(0) | endif',
\ 'InsertLeave if exists(''*ale#engine#Cleanup'') | call ale#cursor#EchoCursorWarning() | endif',
\ 'TextChanged * call ale#Queue(g:ale_lint_delay)',
\ 'TextChangedI * call ale#Queue(g:ale_lint_delay)',
@@ -158,7 +158,7 @@ Execute (g:ale_lint_on_insert_leave = 1 should bind InsertLeave):
AssertEqual
\ [
- \ 'InsertLeave * call ale#Queue(0)',
+ \ 'InsertLeave * if ale#Var(str2nr(expand(''<abuf>'')), ''lint_on_insert_leave'') | call ale#Queue(0) | endif',
\ ],
\ filter(CheckAutocmd('ALEEvents'), 'v:val =~ ''^InsertLeave''')
diff --git a/test/test_cursor_warnings.vader b/test/test_cursor_warnings.vader
index 24652909..2a6156f0 100644
--- a/test/test_cursor_warnings.vader
+++ b/test/test_cursor_warnings.vader
@@ -1,6 +1,10 @@
Before:
Save g:ale_echo_msg_format
Save g:ale_echo_cursor
+ Save b:ale_lint_on_insert_leave
+
+ let g:ale_echo_msg_format = '%code: %%s'
+ let b:ale_lint_on_insert_leave = 0
" We should prefer the error message at column 10 instead of the warning.
let g:ale_buffer_info = {
@@ -91,6 +95,9 @@ Before:
return empty(l:lines) ? '' : l:lines[-1]
endfunction
+ call ale#linter#Reset()
+ call ale#linter#PreventLoading('javascript')
+
After:
Restore
@@ -117,6 +124,8 @@ After:
noautocmd :q!
endif
+ call ale#linter#Reset()
+
Given javascript(A Javscript file with warnings/errors):
var x = 3 + 12345678
var x = 5*2 + parseInt("10");