test/clangd_tests.vim | 33 +++++++++++++++------------------ test/common.vim | 6 +++--- test/tsserver_tests.vim | 2 -- diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 694f20dbfa9229c80def142aa5f396eb547b6d56..223f0bbc55b4d61a947a75a5477412a345c1ab09 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -184,7 +184,7 @@ # buffer as not modified. setlocal nomodified cursor(10, 6) :LspPeekReferences - sleep 10m + sleep 50m var ids = popup_list() assert_equal(2, ids->len()) var filePopupAttrs = ids[0]->popup_getoptions() @@ -526,9 +526,6 @@ settagstack(0, {items: []}) silent! edit Xtest.cpp sleep 600m var lines: list =<< trim END - #include - using namespace std; - class base { public: virtual void print(); @@ -553,35 +550,35 @@ bp->print(); } END setline(1, lines) - :sleep 1 + g:WaitForServerFileLoad(0) - cursor(24, 6) + cursor(21, 6) :LspGotoDeclaration - assert_equal([6, 19], [line('.'), col('.')]) + assert_equal([3, 19], [line('.'), col('.')]) exe "normal! \" - assert_equal([24, 6], [line('.'), col('.')]) + assert_equal([21, 6], [line('.'), col('.')]) assert_equal(1, winnr('$')) :LspGotoDefinition - assert_equal([9, 12], [line('.'), col('.')]) + assert_equal([6, 12], [line('.'), col('.')]) exe "normal! \" - assert_equal([24, 6], [line('.'), col('.')]) + assert_equal([21, 6], [line('.'), col('.')]) assert_equal(1, winnr('$')) # Command modifiers :topleft LspGotoDefinition - assert_equal([9, 12], [line('.'), col('.')]) + assert_equal([6, 12], [line('.'), col('.')]) assert_equal([1, 2], [winnr(), winnr('$')]) close exe "normal! \" - assert_equal([24, 6], [line('.'), col('.')]) + assert_equal([21, 6], [line('.'), col('.')]) :tab LspGotoDefinition - assert_equal([9, 12], [line('.'), col('.')]) + assert_equal([6, 12], [line('.'), col('.')]) assert_equal([2, 2, 1], [tabpagenr(), tabpagenr('$'), winnr('$')]) tabclose exe "normal! \" - assert_equal([24, 6], [line('.'), col('.')]) + assert_equal([21, 6], [line('.'), col('.')]) # FIXME: :LspGotoTypeDef and :LspGotoImpl are supported only with clang-14. # This clangd version is not available in Github CI. @@ -590,7 +587,7 @@ # Error cases # FIXME: The following tests are failing in Github CI. Comment out for now. if 0 :messages clear - cursor(14, 5) + cursor(11, 5) :LspGotoDeclaration var m = execute('messages')->split("\n") assert_equal('Error: declaration is not found', m[1]) @@ -605,13 +602,13 @@ assert_equal('Error: implementation is not found', m[1]) endif # Test for LspPeekDeclaration - cursor(24, 6) + cursor(21, 6) var bnum = bufnr() :LspPeekDeclaration var plist = popup_list() assert_true(1, plist->len()) assert_equal(bnum, plist[0]->winbufnr()) - assert_equal(6, line('.', plist[0])) + assert_equal(3, line('.', plist[0])) popup_clear() # tag stack should not be changed assert_fails("normal! \", 'E555:') @@ -621,7 +618,7 @@ :LspPeekDefinition plist = popup_list() assert_true(1, plist->len()) assert_equal(bnum, plist[0]->winbufnr()) - assert_equal(9, line('.', plist[0])) + assert_equal(6, line('.', plist[0])) popup_clear() # tag stack should not be changed assert_fails("normal! \", 'E555:') diff --git a/test/common.vim b/test/common.vim index cbfd75e0f069f8b74fb8ca751c5fb3521c514848..2ea67af0396af28446cebb4f5b83900f75c33a97 100644 --- a/test/common.vim +++ b/test/common.vim @@ -101,16 +101,16 @@ return slept endfunc # Wait for diagnostic messages from the LSP server. -# Waits for a maximum of (10 * 2000) / 1000 = 20 seconds +# Waits for a maximum of (100 * 200) / 1000 = 20 seconds def g:WaitForDiags(errCount: number) var retries = 0 - while retries < 2000 + while retries < 200 var d = lsp#lsp#ErrorCount() if d.Error == errCount break endif retries += 1 - :sleep 10m + :sleep 100m endwhile assert_equal(errCount, lsp#lsp#ErrorCount().Error) diff --git a/test/tsserver_tests.vim b/test/tsserver_tests.vim index 68f51845ef1638bc208cb344aae94f473c7bb958..156cfc8daa60c9a4f5e53d3f251b351af7ffc2a9 100644 --- a/test/tsserver_tests.vim +++ b/test/tsserver_tests.vim @@ -31,7 +31,6 @@ END setline(1, lines) :redraw! - :sleep 3 g:WaitForServerFileLoad(5) :LspDiagShow var qfl: list> = getloclist(0) @@ -116,7 +115,6 @@ ] setline(1, lines) :redraw! - :sleep 3 g:WaitForServerFileLoad(0) cursor(8, 1)