aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_cd.vim20
-rw-r--r--src/nvim/testdir/test_swap.vim4
2 files changed, 23 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
diff --git a/src/nvim/testdir/test_swap.vim b/src/nvim/testdir/test_swap.vim
index 3c191cd7c7..02bc297de1 100644
--- a/src/nvim/testdir/test_swap.vim
+++ b/src/nvim/testdir/test_swap.vim
@@ -376,4 +376,8 @@ func Test_swap_symlink()
call delete('Xswapdir', 'rf')
endfunc
+func Test_no_swap_file()
+ call assert_equal("\nNo swap file", execute('swapname'))
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab