summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-13 14:08:16 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-13 14:08:16 +0200
commit8e46f7264cc303ae3fd723b2f27badccb1d68fbf (patch)
tree738fe32eb45a4e80a5973220ef2c1f3a311df56f /src/testdir
parent3ff9b185fe36cfa075d08a0a081fb29cf3899a96 (diff)
downloadvim-git-8e46f7264cc303ae3fd723b2f27badccb1d68fbf.tar.gz
updated for version 7.4a.014v7.4a.014
Problem: Test 86 and 89 have a problem with using a shadow dir. Solution: Adjust for the different directory structure. (James McCoy)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test86.in15
-rw-r--r--src/testdir/test89.in5
2 files changed, 17 insertions, 3 deletions
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index 8b4a4c153..ba3557be3 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -857,8 +857,19 @@ fnamemodify = vim.Function('fnamemodify')
cb.append(fnamemodify('.', ':p:h:t'))
cb.append(vim.eval('@%'))
os.chdir('..')
-cb.append(fnamemodify('.', ':p:h:t'))
-cb.append(vim.eval('@%').replace(os.path.sep, '/'))
+path = fnamemodify('.', ':p:h:t')
+if path != 'src':
+ # Running tests from a shadow directory, so move up another level
+ # This will result in @% looking like shadow/testdir/test86.in, hence the
+ # extra fnamemodify
+ os.chdir('..')
+ cb.append(fnamemodify('.', ':p:h:t'))
+ cb.append(fnamemodify(vim.eval('@%'), ':s?^%s.??' % path).replace(os.path.sep, '/'))
+ os.chdir(path)
+ del path
+else:
+ cb.append(fnamemodify('.', ':p:h:t'))
+ cb.append(vim.eval('@%').replace(os.path.sep, '/'))
os.chdir('testdir')
cb.append(fnamemodify('.', ':p:h:t'))
cb.append(vim.eval('@%'))
diff --git a/src/testdir/test89.in b/src/testdir/test89.in
index 2ad3f2558..1c3079f62 100644
--- a/src/testdir/test89.in
+++ b/src/testdir/test89.in
@@ -51,7 +51,10 @@ STARTTEST
:$put h
:"
:let cwd=getcwd()
-:cd ../..
+:cd ..
+:" Tests may be run from a shadow directory, so an extra cd needs to be done to
+:" get above src/
+:if fnamemodify(getcwd(), ':t') != 'src' | cd ../.. | else | cd .. | endif
:$put =''
:$put ='Testing findfile'
:$put =''