mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
tests: Add tests for partials dumping
Also fixed dumping of partials by encode_vim_to_object and added code which is able to work with partials and dictionaries to test/unit/eval/helpers.lua (mostly copied from #5119, except for partials handling).
This commit is contained in:
@@ -672,6 +672,12 @@ describe('json_encode() function', function()
|
||||
exc_exec('call json_encode(function("tr"))'))
|
||||
end)
|
||||
|
||||
it('fails to dump a partial', function()
|
||||
execute('function T() dict\nendfunction')
|
||||
eq('Vim(call):E474: Error while dumping encode_tv2json() argument, itself: attempt to dump function reference',
|
||||
exc_exec('call json_encode(function("T", [1, 2], {}))'))
|
||||
end)
|
||||
|
||||
it('fails to dump a function reference in a list', function()
|
||||
eq('Vim(call):E474: Error while dumping encode_tv2json() argument, index 0: attempt to dump function reference',
|
||||
exc_exec('call json_encode([function("tr")])'))
|
||||
|
Reference in New Issue
Block a user