Skip to content

Commit 97106de

Browse files
Add test for both x and o have won
1 parent bb4221d commit 97106de

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test_tictactoe/test_init.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@ def test_illegal_move():
8686
assert True
8787

8888

89+
def test_x_and_o_won():
90+
board = Board()
91+
board.push((0, 0))
92+
board.push((1, 0))
93+
board.push((0, 1))
94+
board.push((1, 1))
95+
board.push((0, 2))
96+
board.push((1, 2))
97+
try:
98+
board.result()
99+
assert False
100+
except:
101+
assert True
102+
103+
89104
if __name__ == "__main__":
90105
test_result()
91106
test_copy()

0 commit comments

Comments
 (0)