omega-feel
This project has not described itself yet.
Brought by drakestapleton
omega-feel / tests / round40 / replay.wl
| 1 | (* Load tests/oracle.wl first. The first row is the two-arm class declaration. *) |
| 2 | replayFile[file_] := Module[{lines, data, events}, |
| 3 | lines = StringSplit /@ Import[file, "Lines"]; |
| 4 | If[First[lines] =!= {"c", "0", "2"}, Return[$Failed]]; |
| 5 | If[!AllTrue[Rest[lines], Length[#] == 5 && Take[#, 2] == {"t", "0"} && |
| 6 | AllTrue[Drop[#, 2], StringMatchQ[#, DigitCharacter ..] &] &], Return[$Failed]]; |
| 7 | data = ({ToExpression /@ #[[3 ;; 4]], ToExpression[#[[5]]]} &) /@ Rest[lines]; |
| 8 | events = First[run[2, data]]; |
| 9 | ("0 " <> StringRiffle[ToString /@ #, " "]) & /@ events |
| 10 | ] |