]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add test for LspOutline
authorYegappan Lakshmanan <yegappan@yahoo.com>
Mon, 24 Oct 2022 15:35:22 +0000 (08:35 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Mon, 24 Oct 2022 15:35:22 +0000 (08:35 -0700)
test/unit_tests.vim

index 54cf016376a270296c914fe1a533b0e00a56a96d..6ca0c11de6ed82b538cc996ae222c7b79a1518a7 100644 (file)
@@ -743,6 +743,29 @@ def Test_LspIncomingCalls()
   :%bw!
 enddef
 
+# Test for :LspOutline
+def Test_LspOutline()
+  silent! edit Xtest.c
+  sleep 200m
+  var lines: list<string> =<< trim END
+    void aFunc(void)
+    {
+    }
+
+    void bFunc(void)
+    {
+    }
+  END
+  setline(1, lines)
+  :sleep 1
+  :LspOutline
+  assert_equal(2, winnr('$'))
+  var bnum = winbufnr(1)
+  assert_equal('LSP-Outline', bufname(bnum))
+  assert_equal(['Function', '  aFunc', '  bFunc'], getbufline(bnum, 4, '$'))
+  :%bw!
+enddef
+
 def LspRunTests()
   :set nomore
   :set debug=beep