Mercurial > hg
comparison tests/run-tests.py @ 12721:d4e21a9de8bc
tests: accept \-escaped test output
It changes tsttest to accept expected outputs in python-style \-escapes.
It aims to avoid trouble with outputs for non-ascii, color and progress
tests.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 02 Oct 2010 22:57:25 +0900 |
parents | 61642a4679e9 |
children | 53cfde2b3cf9 |
comparison
equal
deleted
inserted
replaced
12720:97fd67f35c00 | 12721:d4e21a9de8bc |
---|---|
544 if pos in expected and expected[pos]: | 544 if pos in expected and expected[pos]: |
545 el = expected[pos].pop(0) | 545 el = expected[pos].pop(0) |
546 | 546 |
547 if el == l: # perfect match (fast) | 547 if el == l: # perfect match (fast) |
548 postout.append(" " + l) | 548 postout.append(" " + l) |
549 elif el and el.decode('string-escape') == l: | |
550 postout.append(" " + el) # \-escape match | |
549 elif (el and | 551 elif (el and |
550 (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or | 552 (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or |
551 el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l))): | 553 el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l))): |
552 postout.append(" " + el) # fallback regex/glob match | 554 postout.append(" " + el) # fallback regex/glob match |
553 else: | 555 else: |