aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/writefile_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/eval/writefile_spec.lua')
-rw-r--r--test/functional/eval/writefile_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/eval/writefile_spec.lua b/test/functional/eval/writefile_spec.lua
index 0bb7523d7e..356680ba7c 100644
--- a/test/functional/eval/writefile_spec.lua
+++ b/test/functional/eval/writefile_spec.lua
@@ -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))