Files
neovim/test/functional/legacy/autochdir_spec.lua
Justin M. Keyes 097c8dccca 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.
2017-01-04 07:23:13 +01:00

27 lines
677 B
Lua

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)