diff options
author | w0rp <devw0rp@gmail.com> | 2017-08-14 23:31:46 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-08-14 23:31:54 +0100 |
commit | 5af82312fbdec54af41fb60daae6aa59b3ee7379 (patch) | |
tree | 00b3cb21e54a3ebf206f7184b72d72f815c74b77 /test/test_ale_init_au_groups.vader | |
parent | 1680f7af630da107bd0124adb434e27eef3e2371 (diff) | |
download | ale-5af82312fbdec54af41fb60daae6aa59b3ee7379.zip |
Set up one BufEnter event used for everything, and add tests for linting when the filetype changes
Diffstat (limited to 'test/test_ale_init_au_groups.vader')
-rw-r--r-- | test/test_ale_init_au_groups.vader | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/test_ale_init_au_groups.vader b/test/test_ale_init_au_groups.vader index c7f56469..da77ccee 100644 --- a/test/test_ale_init_au_groups.vader +++ b/test/test_ale_init_au_groups.vader @@ -107,10 +107,12 @@ Execute (g:ale_pattern_options_enabled = 1 should bind BufReadPost and BufEnter) \ 'BufReadPost * call ale#pattern_options#SetOptions()', \], CheckAutocmd('ALEPatternOptionsGroup') -Execute (g:ale_lint_on_enter = 0 should bind no events): +Execute (g:ale_lint_on_enter = 0 should bind only the BufEnter event): let g:ale_lint_on_enter = 0 - AssertEqual [], CheckAutocmd('ALERunOnEnterGroup') + AssertEqual + \ ['BufEnter * call ale#events#EnterEvent(str2nr(expand(''<abuf>'')))'], + \ CheckAutocmd('ALERunOnEnterGroup') Execute (g:ale_lint_on_enter = 1 should bind the required events): let g:ale_lint_on_enter = 1 @@ -127,18 +129,17 @@ Execute (g:ale_lint_on_filetype_changed = 0 should bind no events): AssertEqual [], CheckAutocmd('ALERunOnFiletypeChangeGroup') -Execute (g:ale_lint_on_filetype_changed = 1 should bind FileType, and required buffer events): +Execute (g:ale_lint_on_filetype_changed = 1 should bind the FileType event): let g:ale_lint_on_filetype_changed = 1 - AssertEqual [ - \ 'BufEnter * let b:ale_original_filetype = &filetype', - \ 'BufReadPost * let b:ale_original_filetype = &filetype', - \ 'FileType * ' - \ . 'if has_key(b:, ''ale_original_filetype'') ' - \ . '&& b:ale_original_filetype isnot# expand(''<amatch>'')' - \ . '| call ale#Queue(300, ''lint_file'')' - \ . '| endif', - \], CheckAutocmd('ALERunOnFiletypeChangeGroup') + AssertEqual + \ [ + \ 'FileType * call ale#events#FileTypeEvent( ' + \ . 'str2nr(expand(''<abuf>'')), ' + \ . 'expand(''<amatch>'')' + \ . ')', + \ ], + \ CheckAutocmd('ALERunOnFiletypeChangeGroup') Execute (g:ale_lint_on_save = 0 should bind no events): let g:ale_lint_on_save = 0 |