summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_autochdir.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-18 18:53:45 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-18 18:53:45 +0000
commit0526815c15170a5926e1008600ec29d42d8b64c2 (patch)
treecb743f2c7be21b9cbf5f711144018539f6e313ee /src/testdir/test_autochdir.vim
parent3cad47038547e694cfa26ba39c399f610d2054bd (diff)
patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was appliedv8.2.3617
Problem: ":verbose pwd" does not mention 'autochdir' was applied. Solution: Remember the last chdir was done by 'autochdir'. (issue #9142)
Diffstat (limited to 'src/testdir/test_autochdir.vim')
-rw-r--r--src/testdir/test_autochdir.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim
index d36d326092..8a78b0de6a 100644
--- a/src/testdir/test_autochdir.vim
+++ b/src/testdir/test_autochdir.vim
@@ -25,4 +25,33 @@ func Test_set_filename()
call delete('samples/Xtest')
endfunc
+func Test_verbose_pwd()
+ let cwd = getcwd()
+ call test_autochdir()
+
+ edit global.txt
+ call assert_match('\[global\].*testdir$', execute('verbose pwd'))
+
+ call mkdir('Xautodir')
+ split Xautodir/local.txt
+ lcd Xautodir
+ call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose pwd'))
+
+ set acd
+ wincmd w
+ call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
+ wincmd w
+ call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
+ set noacd
+ call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
+ wincmd w
+ call assert_match('\[global\].*testdir', execute('verbose pwd'))
+ wincmd w
+ call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose pwd'))
+
+ bwipe!
+ call chdir(cwd)
+ call delete('Xautodir', 'rf')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab