0
0
mirror of https://github.com/vim/vim.git synced 2025-10-18 07:54:29 -04:00

patch 8.2.1793: not consistently giving the "is a directory" warning

Problem:    Not consistently giving the "is a directory" warning.
Solution:   Adjust check for illegal file name and directory. (Yasuhiro
            Matsumoto, closes #7067)
This commit is contained in:
Bram Moolenaar
2020-10-03 17:04:37 +02:00
parent 588d241d44
commit c8fe645c19
3 changed files with 45 additions and 10 deletions

View File

@@ -1587,6 +1587,31 @@ func Test_edit_illegal_filename()
close!
endfunc
" Test for editing a directory
func Test_edit_is_a_directory()
CheckEnglish
let dirname = getcwd() . "/Xdir"
call mkdir(dirname, 'p')
new
redir => msg
exe 'edit' dirname
redir END
call assert_match("is a directory$", split(msg, "\n")[0])
bwipe!
let dirname .= '/'
new
redir => msg
exe 'edit' dirname
redir END
call assert_match("is a directory$", split(msg, "\n")[0])
bwipe!
call delete(dirname, 'rf')
endfunc
" Test for editing a file using invalid file encoding
func Test_edit_invalid_encoding()
CheckEnglish