diff options
Diffstat (limited to 'test/completion')
-rw-r--r-- | test/completion/test_completion_events.vader | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader index fbe18bb6..96182013 100644 --- a/test/completion/test_completion_events.vader +++ b/test/completion/test_completion_events.vader @@ -9,6 +9,8 @@ Before: let g:get_completions_called = 0 let g:feedkeys_calls = [] + let &l:completeopt = 'menu,menuone,preview,noselect,noinsert' + runtime autoload/ale/util.vim function! ale#util#FeedKeys(string, mode) abort @@ -95,6 +97,14 @@ Execute(ale#completion#Show() should remember the completeopt setting and replac call ale#completion#Show('Response', 'Parser') AssertEqual 'menu', b:ale_old_completopt + AssertEqual 'menu,menuone,noselect,noinsert', &l:completeopt + +Execute(ale#completion#Show() should set the preview option if it's set): + let &l:completeopt = 'menu,preview' + + call ale#completion#Show('Response', 'Parser') + + AssertEqual 'menu,preview', b:ale_old_completopt AssertEqual 'menu,menuone,preview,noselect,noinsert', &l:completeopt Execute(ale#completion#OmniFunc() should also remember the completeopt setting and replace it): @@ -103,6 +113,14 @@ Execute(ale#completion#OmniFunc() should also remember the completeopt setting a call ale#completion#OmniFunc(0, '') AssertEqual 'menu', b:ale_old_completopt + AssertEqual 'menu,menuone,noselect,noinsert', &l:completeopt + +Execute(ale#completion#OmniFunc() should set the preview option if it's set): + let &l:completeopt = 'menu,preview' + + call ale#completion#OmniFunc(0, '') + + AssertEqual 'menu,preview', b:ale_old_completopt AssertEqual 'menu,menuone,preview,noselect,noinsert', &l:completeopt Execute(ale#completion#Show() should make the correct feedkeys() call): @@ -127,7 +145,6 @@ Execute(ale#completion#Done() should restore old omnifunc values): Execute(ale#completion#Done() should restore the old completeopt setting): let b:ale_old_completopt = 'menu' - let &l:completeopt = 'menu,menuone,preview,noselect,noinsert' call ale#completion#Done() |