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
30 changes: 30 additions & 0 deletions exercises/practice/connect/TestCases.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ ConnectTest = class(TTestCase)
procedure illegal_diagonal_does_not_make_a_winner;
procedure nobody_wins_crossing_adjacent_angles;
procedure x_wins_crossing_from_left_to_right;
procedure x_wins_with_left_hand_dead_end_fork;
procedure x_wins_with_right_hand_dead_end_fork;
procedure o_wins_crossing_from_top_to_bottom;
procedure x_wins_using_a_convoluted_path;
procedure x_wins_using_a_spiral_path;
Expand Down Expand Up @@ -121,6 +123,34 @@ procedure ConnectTest.x_wins_crossing_from_left_to_right;
TapAssertTrue(Self, 'X wins crossing from left to right', 'X', Connect.winner(board));
end;

// 495e33ed-30a9-4012-b46e-d7c4d5fe13c3
procedure ConnectTest.x_wins_with_left_hand_dead_end_fork;
var
board : TStrArray = ();
begin
board := [
'. . X .',
' X X . .',
' . X X X',
' O O O O'
];
TapAssertTrue(Self, 'X wins with left-hand dead end fork', 'X', Connect.winner(board));
end;

// ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58
procedure ConnectTest.x_wins_with_right_hand_dead_end_fork;
var
board : TStrArray = ();
begin
board := [
'. . X X',
' X X . .',
' . X X .',
' O O O O'
];
TapAssertTrue(Self, 'X wins with right-hand dead end fork', 'X', Connect.winner(board));
end;

// 73d1eda6-16ab-4460-9904-b5f5dd401d0b
procedure ConnectTest.o_wins_crossing_from_top_to_bottom;
var
Expand Down