Silin-Chen's picture
CrossSWE-Bench: current 171-instance release
0e239c6
Raw History Blame Contribute Delete
826 Bytes
"""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}