aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/autochdir_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-01-04 05:22:32 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-01-04 07:23:13 +0100
commit097c8dcccab1f66098e0096c7590ea4eb446dd56 (patch)
tree097dc5fbfe9465816a0651c51d24bf7e7abcb061 /test/functional/legacy/autochdir_spec.lua
parent6ba3b8538245d1176b869734c76f2688709cf106 (diff)
downloadrneovim-097c8dcccab1f66098e0096c7590ea4eb446dd56.tar.gz
rneovim-097c8dcccab1f66098e0096c7590ea4eb446dd56.tar.bz2
rneovim-097c8dcccab1f66098e0096c7590ea4eb446dd56.zip
refactor: Remove VimL function `test_autochdir()`
- Eliminate global test_autochdir. - Eliminate VimL function test_autochdir() - Use a lua test instead. Fails correctly after reverting 0c4347997954 / vim-patch:7.4.2015.
Diffstat (limited to 'test/functional/legacy/autochdir_spec.lua')
-rw-r--r--test/functional/legacy/autochdir_spec.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/legacy/autochdir_spec.lua b/test/functional/legacy/autochdir_spec.lua
new file mode 100644
index 0000000000..06f7c1dd11
--- /dev/null
+++ b/test/functional/legacy/autochdir_spec.lua
@@ -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)