# Script to run the unit-tests for the LSP Vim plugin
-#VIMPRG=${VIMPRG:=/usr/bin/vim}
-export VIMRUNTIME=/home/yega/Documents/vim/opfunc/vim/runtime
-VIMPRG=/home/yega/Documents/vim/opfunc/vim/src/vim
+VIMPRG=${VIMPRG:=/usr/bin/vim}
VIM_CMD="$VIMPRG -u NONE -U NONE -i NONE --noplugin -N --not-a-term"
$VIM_CMD -S unit_tests.vim
:%bw!
enddef
-# Test for LSP omni completion
-def Test_omnicomplete()
- lsp#setOptions({'autoComplete': v:false})
- silent! edit Xtest.c
- var lines: list<string> =<< trim END
- void MyFunc1(void)
- {
- }
-
- void MyFunc2(void)
- {
- }
-
- void f1(void)
- {
- }
- END
- setline(1, lines)
- :sleep 1
- cursor(10, 1)
- feedkeys("oMy\<C-X>\<C-O>\<C-N>();", "xt")
- assert_equal("\tMyFunc2();", getline('.'))
- :%bw!
- lsp#setOptions({'autoComplete': v:true})
-enddef
-
def LspRunTests()
:set nomore
:set debug=beep