feat(decode_string): decode binary string with NULs to Blob

Strings that previously decoded into a msgpack special for representing
BINs with NULs now convert to Blobs. It shouldn't be possible to decode
into this special anymore after this change?

Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
This commit is contained in:
Sean Dewar
2021-07-31 21:45:58 +01:00
parent ef729fb15b
commit de9df825d5
6 changed files with 46 additions and 42 deletions

View File

@@ -364,8 +364,7 @@ describe('msgpack*() functions', function()
command('let dumped = ["\\xC4\\x01\\n"]')
command('let parsed = msgpackparse(dumped)')
command('let dumped2 = msgpackdump(parsed)')
eq({{_TYPE={}, _VAL={'\n'}}}, eval('parsed'))
eq(1, eval('parsed[0]._TYPE is v:msgpack_types.binary'))
eq({'\000'}, eval('parsed'))
eq(1, eval('dumped ==# dumped2'))
end)