From bbd42c2fdd5ae670c6f82fd0b9b0cda91e905596 Mon Sep 17 00:00:00 2001 From: Andreas Louv Date: Mon, 3 Apr 2023 02:31:48 +0200 Subject: [PATCH] Add test for "[count]:LspDiagPrev" --- test/clangd_tests.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 -- 2.48.1