mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
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:
26
test/functional/legacy/autochdir_spec.lua
Normal file
26
test/functional/legacy/autochdir_spec.lua
Normal 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)
|
Reference in New Issue
Block a user