diff options
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/api/vim_spec.lua | 7 | ||||
-rw-r--r-- | test/functional/vimscript/ctx_functions_spec.lua | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index c346dfbe6c..bc7e747916 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1979,6 +1979,13 @@ describe('API', function() nvim('load_context', ctx) eq({1, 2 ,3}, eval('[g:one, g:Two, g:THREE]')) end) + + it('errors when context dictionary is invalid', function() + eq('E474: Failed to convert list to msgpack string buffer', + pcall_err(nvim, 'load_context', { regs = { {} } })) + eq("Empty dictionary keys aren't allowed", + pcall_err(nvim, 'load_context', { regs = { { [''] = '' } } })) + end) end) describe('nvim_replace_termcodes', function() diff --git a/test/functional/vimscript/ctx_functions_spec.lua b/test/functional/vimscript/ctx_functions_spec.lua index 5ee84a6d13..66a8ec3550 100644 --- a/test/functional/vimscript/ctx_functions_spec.lua +++ b/test/functional/vimscript/ctx_functions_spec.lua @@ -375,6 +375,12 @@ describe('context functions', function() eq(outofbounds, pcall_err(call, 'ctxset', {dummy = 1}, 0)) end) + it('errors when context dictionary is invalid', function() + call('ctxpush') + eq('Vim:E474: Failed to convert list to msgpack string buffer', + pcall_err(call, 'ctxset', { regs = { {} } })) + end) + it('sets context dictionary at index in context stack', function() nvim('set_var', 'one', 1) nvim('set_var', 'Two', 2) |