comparison 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
comparison
equal deleted inserted replaced
15735:5688ec97294b 15736:6839f99d2269
117 call CleanFiles() 117 call CleanFiles()
118 let &path = save_path 118 let &path = save_path
119 let &shellslash = save_shellslash 119 let &shellslash = save_shellslash
120 endfunc 120 endfunc
121 121
122 func Test_findfile_error()
123 call assert_fails('call findfile([])', 'E730:')
124 call assert_fails('call findfile("x", [])', 'E730:')
125 call assert_fails('call findfile("x", "", [])', 'E745:')
126 call assert_fails('call findfile("x", "**x")', 'E343:')
127 call assert_fails('call findfile("x", repeat("x", 5000))', 'E854:')
128 endfunc
129
122 " Test finddir({name} [, {path} [, {count}]]) 130 " Test finddir({name} [, {path} [, {count}]])
123 func Test_finddir() 131 func Test_finddir()
124 let save_path = &path 132 let save_path = &path
125 let save_shellslash = &shellslash 133 let save_shellslash = &shellslash
126 let save_dir = getcwd() 134 let save_dir = getcwd()
165 exe 'cd ' . save_dir 173 exe 'cd ' . save_dir
166 call CleanFiles() 174 call CleanFiles()
167 let &path = save_path 175 let &path = save_path
168 let &shellslash = save_shellslash 176 let &shellslash = save_shellslash
169 endfunc 177 endfunc
178
179 func Test_finddir_error()
180 call assert_fails('call finddir([])', 'E730:')
181 call assert_fails('call finddir("x", [])', 'E730:')
182 call assert_fails('call finddir("x", "", [])', 'E745:')
183 call assert_fails('call finddir("x", "**x")', 'E343:')
184 call assert_fails('call finddir("x", repeat("x", 5000))', 'E854:')
185 endfunc