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