]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Handle missing test functions properly
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 2 Apr 2023 22:22:57 +0000 (15:22 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 2 Apr 2023 22:22:57 +0000 (15:22 -0700)
test/runner.vim
test/tsserver_tests.vim

index 484a865f1c6db9cf6d170f7e087b223cbe611a10..e52f3ad56e0b09fbf480ce8fecd9b0704db84578 100644 (file)
@@ -17,6 +17,11 @@ def LspRunTests()
                    ->split("\n")
                    ->map("v:val->substitute('^def ', '', '')")
                    ->sort()
+  if fns->empty()
+    # No tests are found
+    writefile(['No tests are found'], 'results.txt')
+    return
+  endif
   for f in fns
     v:errors = []
     v:errmsg = ''
index d9348a12e86e1a11166ea649fb37d80682238e0c..99e28368beeba952da377a3d0d0f28582ef8ff14 100644 (file)
@@ -13,11 +13,6 @@ var lspServers = [{
 call LspAddServer(lspServers)
 echomsg systemlist($'{lspServers[0].path} --version')
 
-def g:Test_Empty()
-  # At least one test is needed for each file, delete this
-  # whenever a real test is created.
-enddef
-
 # Test for auto-completion.  Make sure that only keywords that matches with the
 # keyword before the cursor are shown.
 # def g:Test_LspCompletion1()