Skip to content

Commit

Permalink
test: Add test_do_not_clear_not_full_row function to test_board.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Apr 9, 2024
1 parent 3dfa622 commit f5c92f6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/game/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5c92f6

Please sign in to comment.