mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
refactor(api): VALIDATE macros #22187
Problem: - API validation involves too much boilerplate. - API validation errors are not consistently worded. Solution: Introduce some macros. Currently these are clumsy, but they at least help with consistency and avoid some nesting.
This commit is contained in:
@@ -543,7 +543,7 @@ 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, [[
|
||||
matches("Invalid command name %(must begin with an uppercase letter%): 'test'", pcall_err(exec_lua, [[
|
||||
vim.api.nvim_create_user_command('test', 'echo "hi"', {})
|
||||
]]))
|
||||
|
||||
|
Reference in New Issue
Block a user