summaryrefslogtreecommitdiff
path: root/test/test_autocmd_commands.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_autocmd_commands.vader')
-rw-r--r--test/test_autocmd_commands.vader23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/test_autocmd_commands.vader b/test/test_autocmd_commands.vader
index 88504a9b..e7e9e86e 100644
--- a/test/test_autocmd_commands.vader
+++ b/test/test_autocmd_commands.vader
@@ -108,17 +108,28 @@ Execute (g:ale_lint_on_insert_leave = 0 should bind no events):
AssertEqual [], CheckAutocmd('ALERunOnInsertLeave')
-Execute (g:ale_pattern_options_enabled = 0 should bind no events):
+Execute (g:ale_pattern_options_enabled = 1 should bind BufReadPost and BufEnter):
+ let g:ale_pattern_options_enabled = 1
+
+ AssertEqual [
+ \ 'BufEnter * call ale#pattern_options#SetOptions(str2nr(expand(''<abuf>'')))',
+ \ 'BufReadPost * call ale#pattern_options#SetOptions(str2nr(expand(''<abuf>'')))',
+ \], CheckAutocmd('ALEPatternOptionsGroup')
+
+Execute (g:ale_pattern_options_enabled = 0 should still bind events):
let g:ale_pattern_options_enabled = 0
- AssertEqual [], CheckAutocmd('ALEPatternOptionsGroup')
+ AssertEqual [
+ \ 'BufEnter * call ale#pattern_options#SetOptions(str2nr(expand(''<abuf>'')))',
+ \ 'BufReadPost * call ale#pattern_options#SetOptions(str2nr(expand(''<abuf>'')))',
+ \], CheckAutocmd('ALEPatternOptionsGroup')
-Execute (g:ale_pattern_options_enabled = 1 should bind BufReadPost and BufEnter):
- let g:ale_pattern_options_enabled = 1
+Execute (g:ale_enabled = 0 should still bind pattern events):
+ let g:ale_enabled = 0
AssertEqual [
- \ 'BufEnter * call ale#pattern_options#SetOptions()',
- \ 'BufReadPost * call ale#pattern_options#SetOptions()',
+ \ 'BufEnter * call ale#pattern_options#SetOptions(str2nr(expand(''<abuf>'')))',
+ \ 'BufReadPost * call ale#pattern_options#SetOptions(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALEPatternOptionsGroup')
Execute (g:ale_lint_on_enter = 0 should bind only the BufEnter event):