| 53 | |
| 54 | |
| 55 | def read_tests(path: str) -> list[tuple[str, str, str, str, list[int]]]: |
| 56 | rows = [] |
| 57 | with open(path, encoding="utf-8") as handle: |
| 58 | for line in handle: |
| 59 | line = line.rstrip("\n") |
| 60 | if not line: |
| 61 | continue |
| 62 | fields = line.split("\t") |
| 63 | if len(fields) != 4 or ":" not in fields[0]: |
| 64 | fail(f"malformed test row in {path}: {line!r}") |
| 65 | suite, test = fields[0].split(":", 1) |
| 66 | ids = [int(token) for token in fields[3].split()] if fields[3] else [] |
| 67 | rows.append((suite, test, fields[1], fields[2], ids)) |
| 68 | return rows |
| 69 | |
| 70 | |
| 71 | def main() -> int: |