Show More
@@ -499,6 +499,13 b' def tsttest(test, options):' | |||||
499 | finally: |
|
499 | finally: | |
500 | os.remove(name) |
|
500 | os.remove(name) | |
501 |
|
501 | |||
|
502 | def rematch(el, l): | |||
|
503 | try: | |||
|
504 | return re.match(el, l) | |||
|
505 | except re.error: | |||
|
506 | # el is an invalid regex | |||
|
507 | return False | |||
|
508 | ||||
502 | pos = -1 |
|
509 | pos = -1 | |
503 | postout = [] |
|
510 | postout = [] | |
504 | for n, l in enumerate(output): |
|
511 | for n, l in enumerate(output): | |
@@ -513,7 +520,7 b' def tsttest(test, options):' | |||||
513 |
|
520 | |||
514 | if el == l: # perfect match (fast) |
|
521 | if el == l: # perfect match (fast) | |
515 | postout.append(" " + l) |
|
522 | postout.append(" " + l) | |
516 |
elif el and re |
|
523 | elif el and rematch(el, l): # fallback regex match | |
517 | postout.append(" " + el) |
|
524 | postout.append(" " + el) | |
518 | else: # mismatch - let diff deal with it |
|
525 | else: # mismatch - let diff deal with it | |
519 | postout.append(" " + l) |
|
526 | postout.append(" " + l) |
General Comments 0
You need to be logged in to leave comments.
Login now