mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00

- Eliminate global test_autochdir.
- Eliminate VimL function test_autochdir()
- Use a lua test instead. Fails correctly after reverting
0c43479979
/ vim-patch:7.4.2015.
27 lines
677 B
Lua
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)
|