aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/command_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-02-16 10:07:18 -0500
committerGitHub <noreply@github.com>2023-02-16 07:07:18 -0800
commit09b3432eaff3abcadb56d61b6f247f992b80b63f (patch)
tree389efec63429f482fcab4bebaeeac6e3d948f14e /test/functional/api/command_spec.lua
parentbcae4af3743dbc8fc51027bbe323ddc9211cd8ca (diff)
downloadrneovim-09b3432eaff3abcadb56d61b6f247f992b80b63f.tar.gz
rneovim-09b3432eaff3abcadb56d61b6f247f992b80b63f.tar.bz2
rneovim-09b3432eaff3abcadb56d61b6f247f992b80b63f.zip
fix(api): allow empty Lua table for nested dicts #22268
Problem: The Lua-API bridge allows Dict params to be empty Lua (list) tables at the function-signature level. But not for _nested_ Dicts, because they are not modeled: https://github.com/neovim/neovim/blob/fae754073289566051433fae74ec65783f9e7a6a/src/nvim/api/keysets.lua#L184 Some API functions like nvim_cmd check for kObjectTypeDictionary and don't handle the case of empty Lua tables (treated as "Array"). Solution: Introduce VALIDATE_T_DICT and use it in places where kObjectTypeDictionary was being checked directly. fixes #21005
Diffstat (limited to 'test/functional/api/command_spec.lua')
-rw-r--r--test/functional/api/command_spec.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/api/command_spec.lua b/test/functional/api/command_spec.lua
index 9db687cc37..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,