aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/testdir/test_autochdir.vim8
-rw-r--r--test/functional/legacy/autochdir_spec.lua9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autochdir.vim b/src/nvim/testdir/test_autochdir.vim
index e172d0cb9a..9ad727241e 100644
--- a/src/nvim/testdir/test_autochdir.vim
+++ b/src/nvim/testdir/test_autochdir.vim
@@ -42,6 +42,14 @@ func Test_verbose_pwd()
set acd
wincmd w
call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
+ execute 'lcd' cwd
+ call assert_match('\[window\].*testdir$', execute('verbose pwd'))
+ execute 'tcd' cwd
+ call assert_match('\[tabpage\].*testdir$', execute('verbose pwd'))
+ execute 'cd' cwd
+ call assert_match('\[global\].*testdir$', execute('verbose pwd'))
+ edit
+ call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
wincmd w
call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
set noacd
diff --git a/test/functional/legacy/autochdir_spec.lua b/test/functional/legacy/autochdir_spec.lua
index 9bb13c1954..37a94476a0 100644
--- a/test/functional/legacy/autochdir_spec.lua
+++ b/test/functional/legacy/autochdir_spec.lua
@@ -28,6 +28,7 @@ describe('autochdir behavior', function()
it(':verbose pwd shows whether autochdir is used', function()
local subdir = 'Xautodir'
command('cd '..dir)
+ local cwd = eval('getcwd()')
command('edit global.txt')
matches('%[global%].*'..dir, exec_capture('verbose pwd'))
call('mkdir', subdir)
@@ -37,6 +38,14 @@ describe('autochdir behavior', function()
command('set autochdir')
command('wincmd w')
matches('%[autochdir%].*'..dir, exec_capture('verbose pwd'))
+ command('lcd '..cwd)
+ matches('%[window%].*'..dir, exec_capture('verbose pwd'))
+ command('tcd '..cwd)
+ matches('%[tabpage%].*'..dir, exec_capture('verbose pwd'))
+ command('cd '..cwd)
+ matches('%[global%].*'..dir, exec_capture('verbose pwd'))
+ command('edit')
+ matches('%[autochdir%].*'..dir, exec_capture('verbose pwd'))
command('wincmd w')
matches('%[autochdir%].*'..dir..'[/\\]'..subdir, exec_capture('verbose pwd'))
command('set noautochdir')