.github/workflows/unitests.yml | 2 +- test/clangd_tests.vim | 21 +++++++++++---------- test/run_tests.cmd | 2 +- diff --git a/.github/workflows/unitests.yml b/.github/workflows/unitests.yml index 6dc7144739bcfdde94965231d6c5318be025b9e2..a7295210ff18b168a41b024cdb92a92e48f2dd77 100644 --- a/.github/workflows/unitests.yml +++ b/.github/workflows/unitests.yml @@ -9,7 +9,7 @@ - name: Install packages run: | sudo apt update # install clangd language server - sudo apt install -y clangd-14 + sudo apt install -y clangd-15 # install nodejs sudo apt install -y curl curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash - diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 2bee0980356b61d55b72f53690b03d44c57b7132..03ec56736759b3c573d87af41ee7b3139c253b0c 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -8,7 +8,7 @@ g:LspOptionsSet(lspOpts) var lspServers = [{ filetype: ['c', 'cpp'], - path: (exepath('clangd-14') ?? exepath('clangd')), + path: (exepath('clangd-15') ?? exepath('clangd')), args: ['--background-index', '--clang-tidy'], initializationOptions: { clangdFileStatus: true }, customNotificationHandlers: { @@ -18,7 +18,7 @@ } } }] call LspAddServer(lspServers) -echomsg systemlist($'{lspServers[0].path} --version') +echomsg systemlist($'{shellescape(lspServers[0].path)} --version') # Test for formatting a file using LspFormat def g:Test_LspFormat() @@ -351,20 +351,21 @@ sleep 200m var bnr: number = bufnr() - setline(1, [ - 'int i = "a";', - 'int j = i;', - 'int y = 0;' - ]) + var lines =<< trim END + int i = "a"; + int j = i; + int y = 0; + END + setline(1, lines) :redraw! # TODO: Waiting count doesn't include Warning, Info, and Hint diags - g:WaitForServerFileLoad(2) + g:WaitForServerFileLoad(3) :LspDiagShow var qfl: list> = getloclist(0) assert_equal('quickfix', getwinvar(winnr('$'), '&buftype')) assert_equal(bnr, qfl[0].bufnr) assert_equal(3, qfl->len()) - assert_equal([1, 5, 'W'], [qfl[0].lnum, qfl[0].col, qfl[0].type]) + assert_equal([1, 5, 'E'], [qfl[0].lnum, qfl[0].col, qfl[0].type]) assert_equal([1, 9, 'E'], [qfl[1].lnum, qfl[1].col, qfl[1].type]) assert_equal([2, 9, 'E'], [qfl[2].lnum, qfl[2].col, qfl[2].type]) close @@ -952,7 +953,7 @@ f1(z); } END setline(1, lines) - g:WaitForServerFileLoad(0) + g:WaitForServerFileLoad(1) cursor(8, 4) var output = execute(':LspHover')->split("\n") assert_equal([], output) diff --git a/test/run_tests.cmd b/test/run_tests.cmd index 925ab7a8e7750f0f6f1be0f4fbb0acecc62db848..863d06dfc16db17d88822230be31ecc1842a3029 100644 --- a/test/run_tests.cmd +++ b/test/run_tests.cmd @@ -6,7 +6,7 @@ SETLOCAL SET VIMPRG="vim.exe" SET VIM_CMD=%VIMPRG% -u NONE -U NONE -i NONE --noplugin -N --not-a-term -%VIM_CMD% -c "let g:TestName=clangd_tests.vim" -S runner.vim +%VIM_CMD% -c "let g:TestName='clangd_tests.vim'" -S runner.vim echo LSP unit test results type results.txt