summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-18 20:47:31 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-18 20:47:31 +0000
commit851c7a699ae00bdc14a4db874cf722b7b7393b53 (patch)
tree28e2e265f8a6d37e892e6e8123032355eb9da331 /src/testdir/test_cd.vim
parent0526815c15170a5926e1008600ec29d42d8b64c2 (diff)
patch 8.2.3618: getcwd() is unclear about how 'autochdir' is usedv8.2.3618
Problem: getcwd() is unclear about how 'autochdir' is used. Solution: Update the help for getcwd(). Without any arguments always return the actual current directory. (closes #9142)
Diffstat (limited to 'src/testdir/test_cd.vim')
-rw-r--r--src/testdir/test_cd.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim
index bcca2f8e7c..81ed491ea5 100644
--- a/src/testdir/test_cd.vim
+++ b/src/testdir/test_cd.vim
@@ -225,4 +225,23 @@ func Test_cd_unknown_dir()
call delete('Xa', 'rf')
endfunc
+func Test_getcwd_actual_dir()
+ let startdir = getcwd()
+ call mkdir('Xactual')
+ call test_autochdir()
+ set autochdir
+ edit Xactual/file.txt
+ call assert_match('testdir.Xactual$', getcwd())
+ lcd ..
+ call assert_match('testdir$', getcwd())
+ edit
+ call assert_match('testdir.Xactual$', getcwd())
+ call assert_match('testdir$', getcwd(win_getid()))
+
+ set noautochdir
+ bwipe!
+ call chdir(startdir)
+ call delete('Xactual', 'rf')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab