feat(api): convert Blobs to API strings

Note that these are not NUL-terminated; the API supports this.
This commit is contained in:
Sean Dewar
2021-08-02 19:13:48 +01:00
parent 10aa60e806
commit 312c783d81
3 changed files with 19 additions and 1 deletions

View File

@@ -155,4 +155,13 @@ describe('eval-API', function()
pcall_err(command, "sandbox call nvim_input('ievil')"))
eq({''}, meths.buf_get_lines(0, 0, -1, true))
end)
it('converts blobs to API strings', function()
command('let g:v1 = nvim__id(0z68656c6c6f)')
command('let g:v2 = nvim__id(v:_null_blob)')
eq(1, eval('type(g:v1)'))
eq(1, eval('type(g:v2)'))
eq('hello', eval('g:v1'))
eq('', eval('g:v2'))
end)
end)