aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-03 11:54:59 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 15:29:19 +0100
commita1ee06a0993ef8959cdcec61759b17aa68ee28bd (patch)
treeaf24b0e68f96d3491a66e564e88def629a0e793b /src
parentcebf31cf705e32ed3b3ac2202884ab6b360f6c52 (diff)
downloadrneovim-a1ee06a0993ef8959cdcec61759b17aa68ee28bd.tar.gz
rneovim-a1ee06a0993ef8959cdcec61759b17aa68ee28bd.tar.bz2
rneovim-a1ee06a0993ef8959cdcec61759b17aa68ee28bd.zip
test/oldtest: restore test_autochdir.vim
We have a ported Lua version, but we should also keep the Vim version around to make merging easier.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_autochdir.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autochdir.vim b/src/nvim/testdir/test_autochdir.vim
new file mode 100644
index 0000000000..05d69631c4
--- /dev/null
+++ b/src/nvim/testdir/test_autochdir.vim
@@ -0,0 +1,19 @@
+" Test 'autochdir' behavior
+
+if !exists("+autochdir")
+ finish
+endif
+
+func Test_set_filename()
+ let cwd = getcwd()
+ call test_autochdir()
+ set acd
+ new
+ w samples/Xtest
+ call assert_equal("Xtest", expand('%'))
+ call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', ''))
+ bwipe!
+ set noacd
+ exe 'cd ' . cwd
+ call delete('samples/Xtest')
+endfunc