summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDonnie West <igneo676@gmail.com>2019-08-17 12:40:05 -0500
committerw0rp <w0rp@users.noreply.github.com>2019-08-17 18:40:05 +0100
commit5388ff1d54e05cfaa9429cdbf9a2cacba94d190f (patch)
tree33d333acf8d89cb59a407b1549701007f51ce5a8 /test
parent28c93ab1854ef41a46855401cc4addbaf7dfb9d4 (diff)
downloadale-5388ff1d54e05cfaa9429cdbf9a2cacba94d190f.zip
Add asyncomplete.vim Support (#2627)
Diffstat (limited to 'test')
-rw-r--r--test/completion/test_completion_events.vader28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader
index 6bc0035e..5672f8e5 100644
--- a/test/completion/test_completion_events.vader
+++ b/test/completion/test_completion_events.vader
@@ -62,6 +62,10 @@ After:
delfunction CheckCompletionCalled
+ if exists('*CompleteCallback')
+ delfunction CompleteCallback
+ endif
+
" Stop any timers we left behind.
" This stops the tests from failing randomly.
call ale#completion#StopTimer()
@@ -333,6 +337,30 @@ Execute(b:ale_completion_info should be set up correctly for other sources):
\ b:ale_completion_info
Assert !exists('b:ale_completion_result')
+Execute(b:ale_completion_info should be set up correctly when requesting completions via callback):
+ let b:ale_completion_result = []
+ call setpos('.', [bufnr(''), 3, 14, 0])
+
+ function! CompleteCallback() abort
+ echo 'Called'
+ endfunction
+
+
+ call ale#completion#GetCompletions('ale-callback', {'callback': funcref('CompleteCallback')})
+
+ AssertEqual
+ \ {
+ \ 'request_id': 0,
+ \ 'conn_id': 0,
+ \ 'column': 14,
+ \ 'line_length': 14,
+ \ 'line': 3,
+ \ 'prefix': 'ab',
+ \ 'source': 'ale-callback',
+ \ },
+ \ b:ale_completion_info
+ Assert !exists('b:ale_completion_result')
+
Execute(The correct keybinds should be configured):
redir => g:output
silent map <Plug>(ale_show_completion_menu)