From: Andreas Louv Date: Mon, 3 Apr 2023 00:26:45 +0000 (+0200) Subject: Add test for "[count]:LspDiagNext" X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2349f325b403a69929349fb68dbd3d0224673e26;p=vim-lsp.git Add test for "[count]:LspDiagNext" --- diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index a46342f..31a4117 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -282,6 +282,16 @@ def g:Test_LspDiag() :LspDiagPrev output = execute('LspDiagPrev')->split("\n") assert_equal('Error: No more diagnostics found', output[0]) + + # :[count]LspDiagNext + cursor(3, 1) + :2LspDiagNext + assert_equal([5, 2], [line('.'), col('.')]) + :2LspDiagNext + assert_equal([7, 2], [line('.'), col('.')]) + output = execute(':2LspDiagNext')->split("\n") + assert_equal('Error: No more diagnostics found', output[0]) + :%d setline(1, ['void blueFunc()', '{', '}']) g:WaitForDiags(0) @@ -435,6 +445,21 @@ def g:Test_LspDiag_Multi() g:LspOptionsSet({showDiagInPopup: true}) + # :[count]LspDiagNext + g:LspOptionsSet({showDiagInPopup: false}) + cursor(1, 1) + :2LspDiagNext + assert_equal([1, 9], [line('.'), col('.')]) + :2LspDiagNext + assert_equal([2, 9], [line('.'), col('.')]) + output = execute(':2LspDiagNext')->split("\n") + assert_equal('Error: No more diagnostics found', output[0]) + + cursor(1, 1) + :99LspDiagNext + assert_equal([2, 9], [line('.'), col('.')]) + g:LspOptionsSet({showDiagInPopup: true}) + bw! enddef