Mercurial > vim
diff src/testdir/test_findfile.vim @ 25364:af5c4fabcf40 v8.2.3219
patch 8.2.3219: :find searches non-existing directories
Commit: https://github.com/vim/vim/commit/7a4ca32175bef0f9a177052796bd9addd10dc218
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Jul 25 15:08:05 2021 +0200
patch 8.2.3219: :find searches non-existing directories
Problem: :find searches non-existing directories.
Solution: Check the path is not "..". Update help. (Christian Brabandt,
closes #8612, closes #8533)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 25 Jul 2021 15:15:04 +0200 |
parents | 08940efa6b4e |
children | d891115c0aea |
line wrap: on
line diff
--- a/src/testdir/test_findfile.vim +++ b/src/testdir/test_findfile.vim @@ -228,4 +228,26 @@ func Test_find_cmd() call assert_fails('tabfind', 'E471:') endfunc +func Test_find_non_existing_path() + new + let save_path = &path + let save_dir = getcwd() + call mkdir('dir1/dir2', 'p') + call writefile([], 'dir1/file.txt') + call writefile([], 'dir1/dir2/base.txt') + call chdir('dir1/dir2') + e base.txt + set path=../include + + call assert_fails(':find file.txt', 'E345:') + + call chdir(save_dir) + bw! + call delete('dir1/dir2/base.txt', 'rf') + call delete('dir1/dir2', 'rf') + call delete('dir1/file.txt', 'rf') + call delete('dir1', 'rf') + let &path = save_path +endfunc + " vim: shiftwidth=2 sts=2 expandtab