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