From f5c92f6bbae3c139144e6af2f85af6c230c5c8a7 Mon Sep 17 00:00:00 2001 From: Sverre Nystad <89105607+SverreNystad@users.noreply.github.com> Date: Tue, 9 Apr 2024 04:07:15 +0200 Subject: [PATCH] test: Add test_do_not_clear_not_full_row function to test_board.py --- test/game/test_board.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/game/test_board.py b/test/game/test_board.py index 5fa4091..5daa21e 100644 --- a/test/game/test_board.py +++ b/test/game/test_board.py @@ -128,6 +128,38 @@ def test_clear_rows(): assert rows_removed == lines_to_remove +def test_do_not_clear_not_full_row(): + board: Board = Board() + board.board = [ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [1, 1, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [1, 1, 1, 1, 0, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + ] + lines_to_remove = 0 + board.printBoard() + rows_removed = board.checkGameState() + board.printBoard() + + assert rows_removed == lines_to_remove + + def test_transition_model_for_no_transition(): current_board: Board = Board() target_board: Board = current_board