refactor: Remove VimL function test_autochdir()

- Eliminate global test_autochdir.
- Eliminate VimL function test_autochdir()
- Use a lua test instead. Fails correctly after reverting
  0c43479979 / vim-patch:7.4.2015.
This commit is contained in:
Justin M. Keyes
2017-01-04 05:22:32 +01:00
parent 6ba3b85382
commit 097c8dccca
9 changed files with 27 additions and 34 deletions

View File

@@ -0,0 +1,26 @@
local lfs = require('lfs')
local helpers = require('test.functional.helpers')(after_each)
local clear, eq = helpers.clear, helpers.eq
local eval, execute = helpers.eval, helpers.execute
describe('autochdir behavior', function()
local dir = 'Xtest-functional-legacy-autochdir'
before_each(function()
lfs.mkdir(dir)
clear()
end)
after_each(function()
helpers.rmdir(dir)
end)
-- Tests vim/vim/777 without test_autochdir().
it('sets filename', function()
execute('set acd')
execute('new')
execute('w '..dir..'/Xtest')
eq('Xtest', eval("expand('%')"))
eq(dir, eval([[substitute(getcwd(), '.*[/\\]\(\k*\)', '\1', '')]]))
end)
end)