Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omnet/blob/main/om/tka/test/check.py # omnet aien-dev/omnet Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omnet / om / tka / test / check.py` 24 lines ยท 1007 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """A mutant must complete normally with exactly the expected record count.""" 3 import pathlib 4 import sys 5 6 want = pathlib.Path(sys.argv[1]).read_text().splitlines() 7 got = pathlib.Path(sys.argv[2]).read_text().splitlines() 8 if len(want) != len(got): 9 for i, (a, b) in enumerate(zip(want, got)): 10 if a != b: 11 print(f"first difference record {i + 1}: expected {a[:240]}, got {b[:240]}") 12 break 13 raise SystemExit(f"FAIL record count: expected {len(want)}, got {len(got)}") 14 bad = [i for i, pair in enumerate(zip(want, got)) if pair[0] != pair[1]] 15 if sys.argv[3] == "mutant": 16 if not bad: 17 raise SystemExit("FAIL mutant survived") 18 print(f"PASS mutant: completed {len(got)} records, {len(bad)} differ") 19 else: 20 if bad: 21 for i in bad[:10]: 22 print(f"record {i + 1}: expected {want[i][:240]}, got {got[i][:240]}") 23 raise SystemExit(f"FAIL {len(bad)} differing records") 24 print(f"PASS {len(got)} differential records")