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.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/lspconfig_spec.lua b/test/lspconfig_spec.lua
index 7bee8ceb..f98568c1 100644
--- a/test/lspconfig_spec.lua
+++ b/test/lspconfig_spec.lua
@@ -213,6 +213,41 @@ describe('lspconfig', function()
]])
end)
end)
+
+ describe('user commands', function()
+ it('should translate command definition to nvim_create_user_command options', function()
+ eq(
+ {
+ nargs = '*',
+ complete = 'custom,v:lua.some_global',
+ },
+ exec_lua [[
+ local util = require("lspconfig.util")
+ return util._parse_user_command_options({
+ function () end,
+ "-nargs=* -complete=custom,v:lua.some_global"
+ })
+ ]]
+ )
+
+ eq(
+ {
+ desc = 'My awesome description.',
+ nargs = '*',
+ complete = 'custom,v:lua.another_global',
+ },
+ exec_lua [[
+ local util = require("lspconfig.util")
+ return util._parse_user_command_options({
+ function () end,
+ ["-nargs"] = "*",
+ "-complete=custom,v:lua.another_global",
+ description = "My awesome description."
+ })
+ ]]
+ )
+ end)
+ end)
end)
describe('config', function()