mirror of
https://github.com/neovim/neovim.git
synced 2026-07-16 22:21:30 +00:00
feat(eval): writefile() treats RPC string as "blob"
related: fb6aeaba2d
This commit is contained in:
@@ -107,11 +107,18 @@ describe('writefile()', function()
|
||||
eq('a\0', read_file(fname))
|
||||
end)
|
||||
|
||||
it('writes Lua (binary) strings to a file', function()
|
||||
it('writes Lua (binary) strings', function()
|
||||
eq(0, exec_lua([[return vim.fn.writefile('foo\0bar', ..., 'b')]], fname))
|
||||
eq('foo\0bar', read_file(fname))
|
||||
end)
|
||||
|
||||
it('writes RPC-API (binary) String', function()
|
||||
eq(0, api.nvim_call_function('writefile', { 'foobar', fname }))
|
||||
eq('foobar', read_file(fname))
|
||||
eq(0, api.nvim_call_function('writefile', { 'foo\0bar', fname }))
|
||||
eq('foo\0bar', read_file(fname))
|
||||
end)
|
||||
|
||||
it('shows correct file name when supplied numbers', function()
|
||||
api.nvim_set_current_dir(dname)
|
||||
eq(
|
||||
|
||||
Reference in New Issue
Block a user