Datasets:
File size: 826 Bytes
0e239c6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """Strict public native RUN/terminal parser; behavior comes only from fresh Go binaries."""
import json,re
from pathlib import Path
def parse(path, expected):
text=Path(path).read_text();run={};terminal={};statuses={}
for line in text.splitlines():
m=re.match(r'^=== RUN\s+(Test\S+)$',line)
if m and '/' not in m[1]:run[m[1]]=run.get(m[1],0)+1
m=re.match(r'^--- (PASS|FAIL|SKIP): (Test\S+) \(',line)
if m and '/' not in m[2]:terminal[m[2]]=terminal.get(m[2],0)+1;statuses[m[2]]=m[1]
assert set(run)==set(expected) and set(terminal)==set(expected),(run,terminal,expected)
assert all(run[x]==terminal[x]==1 and statuses[x] in ('PASS','FAIL') for x in expected),'missing/duplicate/skipped top-level behavior event'
return {'run':run,'terminal':terminal,'statuses':statuses,'feature_and_p2p_events_are_runtime':True}
|