IPVGO: Remove current game history from savefile, re-implement superko (#1175)

This commit is contained in:
Michael Ficocelli
2024-03-20 20:37:20 -04:00
committed by GitHub
parent fc8958af83
commit 1e5f7184a2
12 changed files with 45 additions and 29 deletions
+3 -3
View File
@@ -81,7 +81,7 @@ describe("Netscript Go API unit tests", () => {
it("should correctly retrieve the current game state", async () => {
const board = ["OXX..", ".....", ".....", "...XX", "...X."];
const boardState = boardStateFromSimpleBoard(board, GoOpponent.Daedalus, GoColor.black);
boardState.previousBoard = ["OX..", ".....", ".....", "...XX", "...X."];
boardState.previousBoards = [["OX..", ".....", ".....", "...XX", "...X."]];
Go.currentGame = boardState;
const result = getGameState();
@@ -232,7 +232,7 @@ describe("Netscript Go API unit tests", () => {
await cheatPlayTwoMoves(mockLogger, 4, 3, 3, 4, 1, 0);
expect(mockLogger).toHaveBeenCalledWith("Cheat failed! You have been ejected from the subnet.");
expect(Go.currentGame.previousBoard).toEqual(null);
expect(Go.currentGame.previousBoards).toEqual([]);
});
});
describe("cheatRemoveRouter() tests", () => {
@@ -270,7 +270,7 @@ describe("Netscript Go API unit tests", () => {
await cheatRemoveRouter(mockLogger, 0, 0, 1, 0);
expect(mockLogger).toHaveBeenCalledWith("Cheat failed! You have been ejected from the subnet.");
expect(Go.currentGame.previousBoard).toEqual(null);
expect(Go.currentGame.previousBoards).toEqual([]);
});
});
describe("cheatRepairOfflineNode() tests", () => {