mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
feat(json): convert Blobs to array of byte values
Similiar to how Vim does it, but to be consistent with how Nvim encodes lists, add a space after every comma.
This commit is contained in:
@@ -538,6 +538,11 @@ describe('json_encode() function', function()
|
||||
eq('"þÿþ"', funcs.json_encode('þÿþ'))
|
||||
end)
|
||||
|
||||
it('dumps blobs', function()
|
||||
eq('[]', eval('json_encode(0z)'))
|
||||
eq('[222, 173, 190, 239]', eval('json_encode(0zDEADBEEF)'))
|
||||
end)
|
||||
|
||||
it('dumps numbers', function()
|
||||
eq('0', funcs.json_encode(0))
|
||||
eq('10', funcs.json_encode(10))
|
||||
@@ -769,6 +774,10 @@ describe('json_encode() function', function()
|
||||
eq('""', eval('json_encode($XXX_UNEXISTENT_VAR_XXX)'))
|
||||
end)
|
||||
|
||||
it('can dump NULL blob', function()
|
||||
eq('[]', eval('json_encode(v:_null_blob)'))
|
||||
end)
|
||||
|
||||
it('can dump NULL list', function()
|
||||
eq('[]', eval('json_encode(v:_null_list)'))
|
||||
end)
|
||||
|
Reference in New Issue
Block a user