--- a/tests/run-tests.py Mon Feb 08 12:33:00 2016 -0500
+++ b/tests/run-tests.py Fri Jan 29 14:35:34 2016 +0000
@@ -724,16 +724,19 @@
(br'(?m)^(saved backup bundle to .*\.hg)( \(glob\))?$',
br'\1 (glob)'),
]
+ r.append((self._escapepath(self._testtmp), b'$TESTTMP'))
+ return r
+
+ def _escapepath(self, p):
if os.name == 'nt':
- r.append(
+ return (
(b''.join(c.isalpha() and b'[%s%s]' % (c.lower(), c.upper()) or
c in b'/\\' and br'[/\\]' or c.isdigit() and c or b'\\' + c
- for c in self._testtmp), b'$TESTTMP'))
+ for c in p))
+ )
else:
- r.append((re.escape(self._testtmp), b'$TESTTMP'))
-
- return r
+ return re.escape(p)
def _getenv(self):
"""Obtain environment variables to use during test execution."""