Improve erasure of test numbers in TAP approvals

This commit is contained in:
Martin Hořeňovský 2020-02-13 14:22:18 +01:00
parent c50ba09cde
commit 63b7d6f98e
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
2 changed files with 10 additions and 10 deletions

View file

@ -71,7 +71,7 @@ nanParser = re.compile(r'''
''', re.VERBOSE)
# The weird OR is there to always have at least empty string for group 1
tapTestNumParser = re.compile(r'^(not |)?ok (\d+) -')
tapTestNumParser = re.compile(r'^((?:not ok)|(?:ok)|(?:warning)|(?:info)) (\d+) -')
if len(sys.argv) == 2:
cmdPath = sys.argv[1]
@ -128,7 +128,7 @@ def filterLine(line, isCompact):
line = line.replace(': PASSED', ': passed')
# strip out the test order number in TAP to avoid massive diffs for every change
line = tapTestNumParser.sub("\g<1>ok {test-number} -", line)
line = tapTestNumParser.sub("\g<1> {test-number} -", line)
# strip Catch version number
line = versionParser.sub("<version>", line)