aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/cd_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ex_cmds/cd_spec.lua')
-rw-r--r--test/functional/ex_cmds/cd_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/cd_spec.lua b/test/functional/ex_cmds/cd_spec.lua
index 3cf83cdb3b..74432dbe00 100644
--- a/test/functional/ex_cmds/cd_spec.lua
+++ b/test/functional/ex_cmds/cd_spec.lua
@@ -140,6 +140,27 @@ for _, cmd in ipairs {'cd', 'chdir'} do
end)
end)
+ describe('Local directory gets inherited', function()
+ it('by tabs', function()
+ local globalDir = directories.start
+
+ -- Create a new tab and change directory
+ execute('tabnew')
+ execute('silent t' .. cmd .. ' ' .. directories.tab)
+ eq(globalDir .. '/' .. directories.tab, tcwd())
+
+ -- Create a new tab and verify it has inherited the directory
+ execute('tabnew')
+ eq(globalDir .. '/' .. directories.tab, tcwd())
+
+ -- Change tab and change back, verify that directories are correct
+ execute('tabnext')
+ eq(globalDir, tcwd())
+ execute('tabprevious')
+ eq(globalDir .. '/' .. directories.tab, tcwd())
+ end)
+ end)
+
it('works', function()
local globalDir = directories.start
-- Create a new tab first and verify that is has the same working dir