summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-12-11 16:17:02 +0100
committerBram Moolenaar <Bram@vim.org>2015-12-11 16:17:02 +0100
commit91376b63877c113fe9a3fff2c1b04bf9504f447f (patch)
tree1b5935e090c0b0f49a6b8a491093d088b68268f3 /src/testdir
parent1c57fe8b9450eb29c3e42a94527d4b7514f853e2 (diff)
downloadvim-git-91376b63877c113fe9a3fff2c1b04bf9504f447f.tar.gz
patch 7.4.964v7.4.964
Problem: Test 87 doesn't work in a shadow directory. Solution: Handle the extra subdirectory. (James McCoy, closes #515)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test87.in15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index fedc7959f..2308fde97 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -910,8 +910,19 @@ fnamemodify = vim.Function('fnamemodify')
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%'))
os.chdir('..')
-cb.append(str(fnamemodify('.', ':p:h:t')))
-cb.append(vim.eval('@%').replace(os.path.sep, '/'))
+path = fnamemodify('.', ':p:h:t')
+if path != b'src':
+ # Running tests from a shadow directory, so move up another level
+ # This will result in @% looking like shadow/testdir/test87.in, hence the
+ # slicing to remove the leading path and path separator
+ os.chdir('..')
+ cb.append(str(fnamemodify('.', ':p:h:t')))
+ cb.append(vim.eval('@%')[len(path)+1:].replace(os.path.sep, '/'))
+ os.chdir(path)
+else:
+ cb.append(str(fnamemodify('.', ':p:h:t')))
+ cb.append(vim.eval('@%').replace(os.path.sep, '/'))
+del path
os.chdir('testdir')
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%'))