diff src/testdir/test_writefile.vim @ 20178:2fb397573541

patch 8.2.0644: insufficient testing for invalid function arguments Commit: https://github.com/vim/vim/commit/99fa721944dda9d07c53c907c33466728df5c271 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 26 15:59:55 2020 +0200 patch 8.2.0644: insufficient testing for invalid function arguments Problem: Insufficient testing for invalid function arguments. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5988)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Apr 2020 16:00:04 +0200
parents 1697a25328fd
children 116c7bd5e980
line wrap: on
line diff
--- a/src/testdir/test_writefile.vim
+++ b/src/testdir/test_writefile.vim
@@ -207,6 +207,12 @@ func Test_saveas()
   close!
   enew | only
   call delete('Xfile')
+
+  call writefile(test_null_list(), 'Xfile')
+  call assert_false(filereadable('Xfile'))
+  call writefile(test_null_blob(), 'Xfile')
+  call assert_false(filereadable('Xfile'))
+  call assert_fails('call writefile([], "")', 'E482:')
 endfunc
 
 func Test_write_errors()
@@ -245,6 +251,12 @@ func Test_write_errors()
   close
 
   call delete('Xfile')
+
+  call writefile(test_null_list(), 'Xfile')
+  call assert_false(filereadable('Xfile'))
+  call writefile(test_null_blob(), 'Xfile')
+  call assert_false(filereadable('Xfile'))
+  call assert_fails('call writefile([], "")', 'E482:')
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab