aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_edit.vim
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2020-10-04 11:34:50 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2020-10-06 08:21:51 +0900
commit0f078bdde8aea9424281206ea96b4626ce6ff944 (patch)
treee9bc8d08889fe0af5937233ef7665f861170cbc0 /src/nvim/testdir/test_edit.vim
parentf6ac375604238c94d3dc3eeb9b82e67417460806 (diff)
downloadrneovim-0f078bdde8aea9424281206ea96b4626ce6ff944.tar.gz
rneovim-0f078bdde8aea9424281206ea96b4626ce6ff944.tar.bz2
rneovim-0f078bdde8aea9424281206ea96b4626ce6ff944.zip
vim-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 vim/vim#7067) https://github.com/vim/vim/commit/c8fe645c198e2ca55c4e3446efbbdb9b995c63ce
Diffstat (limited to 'src/nvim/testdir/test_edit.vim')
-rw-r--r--src/nvim/testdir/test_edit.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index 7f456ffbce..97a8ad25a3 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -1534,3 +1534,30 @@ func Test_edit_noesckeys()
bwipe!
" set esckeys
endfunc
+
+" Test for editing a directory
+" Todo: "is a directory" message is not displayed in Windows.
+func Test_edit_is_a_directory()
+ CheckEnglish
+ CheckNotMSWindows
+ 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