diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-12-07 05:57:31 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 05:57:31 -0800 |
commit | e42f03264b424450b560a69994879f09b6c555d8 (patch) | |
tree | 4d18136e38aaa7e0afed05e8e7a6b3a754e39089 /test/functional/api/vim_spec.lua | |
parent | 5fa88a7ae13effc02d42070313d3082bf98e22a7 (diff) | |
parent | a16218d4c6773c474011149661470af6e8c90892 (diff) | |
download | rneovim-e42f03264b424450b560a69994879f09b6c555d8.tar.gz rneovim-e42f03264b424450b560a69994879f09b6c555d8.tar.bz2 rneovim-e42f03264b424450b560a69994879f09b6c555d8.zip |
Merge #26426 allow empty string key in msgpack => Vim conversion
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 7287666190..abae346701 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1319,6 +1319,10 @@ describe('API', function() eq("Key not found: lua", pcall_err(meths.del_var, 'lua')) meths.set_var('lua', 1) + -- Empty keys are allowed in Vim dicts (and msgpack). + nvim('set_var', 'dict_empty_key', {[''] = 'empty key'}) + eq({[''] = 'empty key'}, nvim('get_var', 'dict_empty_key')) + -- Set locked g: var. command('lockvar lua') eq('Key is locked: lua', pcall_err(meths.del_var, 'lua')) @@ -1983,7 +1987,7 @@ describe('API', function() it('errors when context dictionary is invalid', function() eq('E474: Failed to convert list to msgpack string buffer', pcall_err(nvim, 'load_context', { regs = { {} }, jumps = { {} } })) - eq("Empty dictionary keys aren't allowed", + eq('E474: Failed to convert list to msgpack string buffer', pcall_err(nvim, 'load_context', { regs = { { [''] = '' } } })) end) end) |