mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
eval: add v:_null_string
Replacement for Vim's test_null_string(). Vim uses it to verify that its codebase handles null strings. Preparation for the Test_null_list() in patch v8.2.1822. Use v:_null_string, not non-existent env var, for null string tests. Mention v:_null_string in id() because id(v:_null_string) returns (nil).
This commit is contained in:
@@ -59,6 +59,16 @@ describe('writefile()', function()
|
||||
eq('\n', read_file(fname))
|
||||
end)
|
||||
|
||||
it('writes list with a null string to a file', function()
|
||||
eq(0, exc_exec(
|
||||
('call writefile([v:_null_string], "%s", "b")'):format(
|
||||
fname)))
|
||||
eq('', read_file(fname))
|
||||
eq(0, exc_exec(('call writefile([v:_null_string], "%s")'):format(
|
||||
fname)))
|
||||
eq('\n', read_file(fname))
|
||||
end)
|
||||
|
||||
it('appends to a file', function()
|
||||
eq(nil, read_file(fname))
|
||||
eq(0, funcs.writefile({'abc', 'def', 'ghi'}, fname))
|
||||
|
Reference in New Issue
Block a user