]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add test for "[count]:LspDiagNext"
authorAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 00:26:45 +0000 (02:26 +0200)
committerAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 00:52:13 +0000 (02:52 +0200)
test/clangd_tests.vim

index a46342f34e3fad9bc7cd07ce3d7717291b4255e3..31a41178a97faefb814d728575f73fceb4e719b2 100644 (file)
@@ -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