Mercurial > public > mercurial-scm > hg
diff tests/run-tests.py @ 47571:e9c5c368be17
run-tests: also catch double-escapes for $TESTTMP
On Windows the `$TESTTMP` string "repr" is different than its value, because `\`
become `\\`. We introduce a new `$STR_REPR_TESTTMP` substitution to match that
too.
Differential Revision: https://phab.mercurial-scm.org/D11001
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 23 Jun 2021 14:34:55 +0200 |
parents | 23f5ed6dbcb1 |
children | 75b623801f6a |
line wrap: on
line diff
--- a/tests/run-tests.py Thu Jul 08 17:13:18 2021 +0200 +++ b/tests/run-tests.py Wed Jun 23 14:34:55 2021 +0200 @@ -1308,6 +1308,11 @@ (br'\bHG_TXNID=TXN:[a-f0-9]{40}\b', br'HG_TXNID=TXN:$ID$'), ] r.append((self._escapepath(self._testtmp), b'$TESTTMP')) + if os.name == 'nt': + # JSON output escapes backslashes in Windows paths, so also catch a + # double-escape. + replaced = self._testtmp.replace(b'\\', br'\\') + r.append((self._escapepath(replaced), b'$STR_REPR_TESTTMP')) replacementfile = os.path.join(self._testdir, b'common-pattern.py')