mirror of
https://github.com/dense-analysis/ale
synced 2024-12-30 01:52:13 +00:00
27 lines
826 B
Plaintext
27 lines
826 B
Plaintext
Before:
|
|
function! MockAlwaysGetCompletions() abort
|
|
let g:get_completions_called = 0
|
|
let g:always_get_completions_argument = -1
|
|
|
|
function! ale#completion#AlwaysGetCompletions(need_prefix) abort
|
|
let g:get_completions_called = 1
|
|
let g:always_get_completions_argument = a:need_prefix
|
|
endfunction
|
|
endfunction
|
|
|
|
call MockAlwaysGetCompletions()
|
|
|
|
After:
|
|
unlet! g:get_completions_called
|
|
unlet! g:always_get_completions_argument
|
|
delfunction MockAlwaysGetCompletions
|
|
delfunction ale#completion#AlwaysGetCompletions
|
|
|
|
runtime autoload/ale/completion.vim
|
|
|
|
Execute(ale#completion#AlwaysGetCompletions should be called when ALEComplete is executed):
|
|
AssertEqual 0, g:get_completions_called
|
|
ALEComplete
|
|
AssertEqual 1, g:get_completions_called
|
|
AssertEqual 0, g:always_get_completions_argument
|