Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions exercises/practice/connect/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ description = "nobody wins crossing adjacent angles"
[cd61c143-92f6-4a8d-84d9-cb2b359e226b]
description = "X wins crossing from left to right"

[495e33ed-30a9-4012-b46e-d7c4d5fe13c3]
description = "X wins with left-hand dead end fork"

[ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58]
description = "X wins with right-hand dead end fork"

[73d1eda6-16ab-4460-9904-b5f5dd401d0b]
description = "O wins crossing from top to bottom"

Expand Down
22 changes: 21 additions & 1 deletion exercises/practice/connect/connect_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/connect/canonical-data.json
# File last updated on 2026-02-19
# File last updated on 2026-05-01

import unittest

Expand Down Expand Up @@ -75,6 +75,26 @@ def test_x_wins_crossing_from_left_to_right(self):
winner = game.get_winner()
self.assertEqual(winner, "X")

def test_x_wins_with_left_hand_dead_end_fork(self):
game = ConnectGame(
""". . X .
X X . .
. X X X
O O O O"""
)
winner = game.get_winner()
self.assertEqual(winner, "X")

def test_x_wins_with_right_hand_dead_end_fork(self):
game = ConnectGame(
""". . X X
X X . .
. X X .
O O O O"""
)
winner = game.get_winner()
self.assertEqual(winner, "X")

def test_o_wins_crossing_from_top_to_bottom(self):
game = ConnectGame(
""". O . .
Expand Down
Loading