Mercurial > vim
changeset 7318:de124c05fe4f v7.4.964
commit https://github.com/vim/vim/commit/91376b63877c113fe9a3fff2c1b04bf9504f447f
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 11 16:17:02 2015 +0100
patch 7.4.964
Problem: Test 87 doesn't work in a shadow directory.
Solution: Handle the extra subdirectory. (James McCoy, closes https://github.com/vim/vim/issues/515)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 11 Dec 2015 16:30:04 +0100 |
parents | 9061e3d5a6bb |
children | 3d7c9075466b |
files | src/testdir/test87.in src/version.c |
diffstat | 2 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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('@%'))