From 312c783d81544df7ab3342f4b3316ced931e89b8 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Mon, 2 Aug 2021 19:13:48 +0100 Subject: feat(api): convert Blobs to API strings Note that these are not NUL-terminated; the API supports this. --- test/functional/eval/api_functions_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional/eval/api_functions_spec.lua') diff --git a/test/functional/eval/api_functions_spec.lua b/test/functional/eval/api_functions_spec.lua index 7d09a652ba..d07e74d40e 100644 --- a/test/functional/eval/api_functions_spec.lua +++ b/test/functional/eval/api_functions_spec.lua @@ -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) -- cgit