Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
47570:bc01b8ad6134 | 47571:e9c5c368be17 |
---|---|
1306 self._portmap(2), | 1306 self._portmap(2), |
1307 (br'([^0-9])%s' % re.escape(self._localip()), br'\1$LOCALIP'), | 1307 (br'([^0-9])%s' % re.escape(self._localip()), br'\1$LOCALIP'), |
1308 (br'\bHG_TXNID=TXN:[a-f0-9]{40}\b', br'HG_TXNID=TXN:$ID$'), | 1308 (br'\bHG_TXNID=TXN:[a-f0-9]{40}\b', br'HG_TXNID=TXN:$ID$'), |
1309 ] | 1309 ] |
1310 r.append((self._escapepath(self._testtmp), b'$TESTTMP')) | 1310 r.append((self._escapepath(self._testtmp), b'$TESTTMP')) |
1311 if os.name == 'nt': | |
1312 # JSON output escapes backslashes in Windows paths, so also catch a | |
1313 # double-escape. | |
1314 replaced = self._testtmp.replace(b'\\', br'\\') | |
1315 r.append((self._escapepath(replaced), b'$STR_REPR_TESTTMP')) | |
1311 | 1316 |
1312 replacementfile = os.path.join(self._testdir, b'common-pattern.py') | 1317 replacementfile = os.path.join(self._testdir, b'common-pattern.py') |
1313 | 1318 |
1314 if os.path.exists(replacementfile): | 1319 if os.path.exists(replacementfile): |
1315 data = {} | 1320 data = {} |