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

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