2019-01-07 12:55:55 -05:00
|
|
|
Before:
|
|
|
|
function! MockAlwaysGetCompletions() abort
|
|
|
|
let g:get_completions_called = 0
|
2019-01-08 09:09:59 -05:00
|
|
|
let g:always_get_completions_argument = -1
|
2019-01-07 12:55:55 -05:00
|
|
|
|
2019-01-08 09:09:59 -05:00
|
|
|
function! ale#completion#AlwaysGetCompletions(need_prefix) abort
|
2019-01-07 12:55:55 -05:00
|
|
|
let g:get_completions_called = 1
|
2019-01-08 09:09:59 -05:00
|
|
|
let g:always_get_completions_argument = a:need_prefix
|
2019-01-07 12:55:55 -05:00
|
|
|
endfunction
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call MockAlwaysGetCompletions()
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! g:get_completions_called
|
2019-01-08 09:09:59 -05:00
|
|
|
unlet! g:always_get_completions_argument
|
2019-01-07 12:55:55 -05:00
|
|
|
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
|
2019-01-08 09:09:59 -05:00
|
|
|
AssertEqual 0, g:always_get_completions_argument
|