diff options
author | w0rp <devw0rp@gmail.com> | 2017-08-22 21:19:36 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-08-22 21:19:36 +0100 |
commit | 1a524ca63e51092ab10febea40a6f018b6e85173 (patch) | |
tree | 3d12ec01af3bfebd1bb59b7e6727f750f5641d8e /test/test_set_list_timers.vader | |
parent | 47a8ebc8b9ae76ee2b23e388d30324b97e102eed (diff) | |
download | ale-1a524ca63e51092ab10febea40a6f018b6e85173.zip |
#653 - Always set loclist or quickfix in a timer callback, which prevents errors E924, E925, and E926
Diffstat (limited to 'test/test_set_list_timers.vader')
-rw-r--r-- | test/test_set_list_timers.vader | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/test_set_list_timers.vader b/test/test_set_list_timers.vader new file mode 100644 index 00000000..90aacb55 --- /dev/null +++ b/test/test_set_list_timers.vader @@ -0,0 +1,38 @@ +Before: + Save g:ale_set_lists_synchronously + Save g:ale_open_list + + let g:ale_set_lists_synchronously = 0 + +After: + Restore + + sleep 1ms + call setloclist(0, []) + lclose + +Execute(The SetLists function should work when run in a timer): + call ale#list#SetLists(bufnr(''), [ + \ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'}, + \]) + sleep 1ms + AssertEqual [{ + \ 'lnum': 5, + \ 'bufnr': bufnr(''), + \ 'col': 5, + \ 'text': 'x', + \ 'valid': 1, + \ 'vcol': 0, + \ 'nr': 0, + \ 'type': 'E', + \ 'pattern': '', + \}], getloclist(0) + +Execute(The CloseWindowIfNeeded function should work when run in a timer): + let g:ale_open_list = 1 + lopen + + call ale#list#CloseWindowIfNeeded(bufnr('')) + sleep 1ms + + Assert !ale#list#IsQuickfixOpen(), 'The window was not closed!' |