aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/command_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /test/functional/api/command_spec.lua
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-21cb7d04c387e4198ca8098a884c78b56ffcf4c2.tar.gz
rneovim-21cb7d04c387e4198ca8098a884c78b56ffcf4c2.tar.bz2
rneovim-21cb7d04c387e4198ca8098a884c78b56ffcf4c2.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'test/functional/api/command_spec.lua')
-rw-r--r--test/functional/api/command_spec.lua16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/functional/api/command_spec.lua b/test/functional/api/command_spec.lua
index d0fb26edc7..1ddb289ded 100644
--- a/test/functional/api/command_spec.lua
+++ b/test/functional/api/command_spec.lua
@@ -24,7 +24,7 @@ describe('nvim_get_commands', function()
eq({}, meths.get_commands({builtin=false}))
end)
- it('validates input', function()
+ it('validation', function()
eq('builtin=true not implemented', pcall_err(meths.get_commands,
{builtin=true}))
eq("Invalid key: 'foo'", pcall_err(meths.get_commands,
@@ -543,23 +543,19 @@ describe('nvim_create_user_command', function()
end)
it('does not allow invalid command names', function()
- matches("'name' must begin with an uppercase letter", pcall_err(exec_lua, [[
+ eq("Invalid command name (must start with uppercase): 'test'", pcall_err(exec_lua, [[
vim.api.nvim_create_user_command('test', 'echo "hi"', {})
]]))
-
- matches('Invalid command name', pcall_err(exec_lua, [[
+ eq("Invalid command name: 't@'", pcall_err(exec_lua, [[
vim.api.nvim_create_user_command('t@', 'echo "hi"', {})
]]))
-
- matches('Invalid command name', pcall_err(exec_lua, [[
+ eq("Invalid command name: 'T@st'", pcall_err(exec_lua, [[
vim.api.nvim_create_user_command('T@st', 'echo "hi"', {})
]]))
-
- matches('Invalid command name', pcall_err(exec_lua, [[
+ eq("Invalid command name: 'Test!'", pcall_err(exec_lua, [[
vim.api.nvim_create_user_command('Test!', 'echo "hi"', {})
]]))
-
- matches('Invalid command name', pcall_err(exec_lua, [[
+ eq("Invalid command name: '💩'", pcall_err(exec_lua, [[
vim.api.nvim_create_user_command('💩', 'echo "hi"', {})
]]))
end)