aboutsummaryrefslogtreecommitdiffstats
path: root/test/lspconfig_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/lspconfig_spec.lua')
-rw-r--r--test/lspconfig_spec.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lspconfig_spec.lua b/test/lspconfig_spec.lua
index 8fc117c5..89effd47 100644
--- a/test/lspconfig_spec.lua
+++ b/test/lspconfig_spec.lua
@@ -190,6 +190,29 @@ describe('lspconfig', function()
]])
end)
end)
+
+ describe('strip_archive_subpath', function()
+ it('strips zipfile subpaths', function()
+ ok(exec_lua [[
+ local lspconfig = require("lspconfig")
+ return lspconfig.util.strip_archive_subpath("zipfile:///one/two.zip::three/four") == "/one/two.zip"
+ ]])
+ end)
+
+ it('strips tarfile subpaths', function()
+ ok(exec_lua [[
+ local lspconfig = require("lspconfig")
+ return lspconfig.util.strip_archive_subpath("tarfile:/one/two.tgz::three/four") == "/one/two.tgz"
+ ]])
+ end)
+
+ it('returns non-archive paths as-is', function()
+ ok(exec_lua [[
+ local lspconfig = require("lspconfig")
+ return lspconfig.util.strip_archive_subpath("/one/two.zip") == "/one/two.zip"
+ ]])
+ end)
+ end)
end)
describe('config', function()
it('normalizes user, server, and base default configs', function()