aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_cd.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-07-31 19:15:36 -0400
committerGitHub <noreply@github.com>2021-07-31 19:15:36 -0400
commita5c25e4f3ee1bbfd44f087a7b5b5a81b7ed20365 (patch)
tree4518d00e916ce72f130e86ac687fdc43697373bf /src/nvim/testdir/test_cd.vim
parent24f2b9ef1cee4945736dc339b18c1eba1ef0d5ed (diff)
parent927383f212bfecd224e9071da363c17655a3e415 (diff)
downloadrneovim-a5c25e4f3ee1bbfd44f087a7b5b5a81b7ed20365.tar.gz
rneovim-a5c25e4f3ee1bbfd44f087a7b5b5a81b7ed20365.tar.bz2
rneovim-a5c25e4f3ee1bbfd44f087a7b5b5a81b7ed20365.zip
Merge pull request #15228 from janlazo/vim-8.2.3002
vim-patch:8.2.{3002,3019,3025,3030,3032,3044,3046,3063,3101,3115,3119,3120,3131,3136,3140,3157,3163,3218,3245,3254}
Diffstat (limited to 'src/nvim/testdir/test_cd.vim')
-rw-r--r--src/nvim/testdir/test_cd.vim20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim
index 770ed55b8d..02a23bf82f 100644
--- a/src/nvim/testdir/test_cd.vim
+++ b/src/nvim/testdir/test_cd.vim
@@ -1,4 +1,7 @@
-" Test for :cd
+" Test for :cd and chdir()
+
+source shared.vim
+source check.vim
func Test_cd_large_path()
" This used to crash with a heap write overflow.
@@ -65,3 +68,18 @@ func Test_cd_with_cpo_chdir()
set cpo&
bw!
endfunc
+
+func Test_cd_from_non_existing_dir()
+ CheckNotMSWindows
+
+ let saveddir = getcwd()
+ call mkdir('Xdeleted_dir')
+ cd Xdeleted_dir
+ call delete(saveddir .. '/Xdeleted_dir', 'd')
+
+ " Expect E187 as the current directory was deleted.
+ call assert_fails('pwd', 'E187:')
+ call assert_equal('', getcwd())
+ cd -
+ call assert_equal(saveddir, getcwd())
+endfunc