Commit d3f4f4ad authored by Christoph Hasse's avatar Christoph Hasse 🤸🏻
Browse files

make the test a bit more specific by requiring some numbers to be greater than 0

parent b8e23989
......@@ -5,8 +5,16 @@
<argument name="reference"><text>refs/Timeline.ref</text></argument>
<argument name="validator"><text>
# Default validation, but validating the timeline file rather that the output
def replacer(inp):
# since time and time difference will be different each time we test
# let's at least check that the numbers we expect to get are all non zero
def zeroIsErr(x):
return '-' if int(x) > 0 else 'err'
return zeroIsErr(inp.group(1)) + ' ' + zeroIsErr(inp.group(2)) + ' ' + inp.group(3) + ' ' + zeroIsErr(inp.group(4))
preproc = (normalizeExamples +
RegexpReplacer(r'^[0-9]+ [0-9]+ ([^ ]+) [0-9]+', r'- - \1 -'))
RegexpReplacer(r'^([0-9]+) ([0-9]+) ([^ ]+) ([0-9]+)', replacer))
validateWithReference(stdout=open('myTimeline.csv').read(), stderr='', preproc=preproc)
</text></argument>
</extension>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment