diff src/testdir/test_findfile.vim @ 15736:6839f99d2269 v8.1.0875

patch 8.1.0875: not all errors of marks and findfile()/finddir() are tested commit https://github.com/vim/vim/commit/71b13e92ae580038b8aecbb783296c577ca2ba5a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 4 21:14:45 2019 +0100 patch 8.1.0875: not all errors of marks and findfile()/finddir() are tested Problem: Not all errors of marks and findfile()/finddir() are tested. Solution: Add more test coverage. (Dominique Pelle)
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Feb 2019 21:15:07 +0100
parents 977a05589b65
children 73ddc462979d
line wrap: on
line diff
--- a/src/testdir/test_findfile.vim
+++ b/src/testdir/test_findfile.vim
@@ -119,6 +119,14 @@ func Test_findfile()
   let &shellslash = save_shellslash
 endfunc
 
+func Test_findfile_error()
+  call assert_fails('call findfile([])', 'E730:')
+  call assert_fails('call findfile("x", [])', 'E730:')
+  call assert_fails('call findfile("x", "", [])', 'E745:')
+  call assert_fails('call findfile("x", "**x")', 'E343:')
+  call assert_fails('call findfile("x", repeat("x", 5000))', 'E854:')
+endfunc
+
 " Test finddir({name} [, {path} [, {count}]])
 func Test_finddir()
   let save_path = &path
@@ -167,3 +175,11 @@ func Test_finddir()
   let &path = save_path
   let &shellslash = save_shellslash
 endfunc
+
+func Test_finddir_error()
+  call assert_fails('call finddir([])', 'E730:')
+  call assert_fails('call finddir("x", [])', 'E730:')
+  call assert_fails('call finddir("x", "", [])', 'E745:')
+  call assert_fails('call finddir("x", "**x")', 'E343:')
+  call assert_fails('call finddir("x", repeat("x", 5000))', 'E854:')
+endfunc