summaryrefslogtreecommitdiff
path: root/src/testdir/test_writefile.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-26 15:59:55 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-26 15:59:55 +0200
commit99fa721944dda9d07c53c907c33466728df5c271 (patch)
tree7ead4c06b56e21eb208ea1b9673cd463ba13f3c0 /src/testdir/test_writefile.vim
parente297802d6ddbebbf36f9a2d01127c034fab88b3b (diff)
downloadvim-git-99fa721944dda9d07c53c907c33466728df5c271.tar.gz
patch 8.2.0644: insufficient testing for invalid function argumentsv8.2.0644
Problem: Insufficient testing for invalid function arguments. Solution: Add more tests. (Yegappan Lakshmanan, closes #5988)
Diffstat (limited to 'src/testdir/test_writefile.vim')
-rw-r--r--src/testdir/test_writefile.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_writefile.vim b/src/testdir/test_writefile.vim
index 497fa0bc7..58e438c89 100644
--- 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