checkComputerSave beta
Function of @v12-engine/engine/testing
ts
export declare function checkComputerSave(make: () => World | Promise<World>, options: {
from: number;
ticks: number;
rules: Rules;
}): Promise<DecisionsApart | null>;The seventh invariant of a computer player: a game saved at tick from and loaded makes the same decisions from then on as the game it was saved from, under the same commands. Makes the world with make (its computers seated, as a game seats them), runs it to from, saves it as a file would keep it and loads that with game, then runs both to ticks and compares what every computer decided. What lost rng, tasks or memory in a restore shows as
expect(await checkComputerSave(() = duel(), from: 600, ticks: 2400, rules: melee )).toBeNull()