test/functional: cd_spec: Add tests for {getcwd,haslocaldir}(-1, -1)

This commit is contained in:
James McCoy 2016-06-01 00:40:03 -04:00
parent a1303c2e11
commit a3f11ad27a

View File

@ -119,6 +119,25 @@ for _, cmd in ipairs {'cd', 'chdir'} do
end)
end)
describe('getcwd(-1, -1)', function()
it('works', function()
eq(directories.start, cwd(-1, -1))
eq(0, lwd(-1, -1))
end)
it('works with tab-local pwd', function()
execute('silent t' .. cmd .. ' ' .. directories.tab)
eq(directories.start, cwd(-1, -1))
eq(0, lwd(-1, -1))
end)
it('works with window-local pwd', function()
execute('silent l' .. cmd .. ' ' .. directories.window)
eq(directories.start, cwd(-1, -1))
eq(0, lwd(-1, -1))
end)
end)
it('works', function()
local globalDir = directories.start
-- Create a new tab first and verify that is has the same working dir