Skip to content

Commit

Permalink
Add test case draw_when_king_and_bishop_versus_king
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBRO committed Mar 23, 2022
1 parent ccd86be commit 59b455d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/play_game_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
get_pieces_list/1,
index_moves/1,
set_game_winner/1,
draw_when_king_and_bishop_versus_king/1,
print_board_when_game_undefined/1
]).

Expand All @@ -63,6 +64,7 @@ groups() ->
index_moves,
set_game_winner,
rule50,
draw_when_king_and_bishop_versus_king,
print_board_when_game_undefined
]}].

Expand Down Expand Up @@ -560,6 +562,27 @@ set_game_winner(Config) ->

ok.

%% draw_when_king_and_bishop_versus_king/1
draw_when_king_and_bishop_versus_king(Config) ->
Pid = get_pid(Config),
% White King and Bishop on light square vs Black King
{ok,{draw,insufficient_material}} = binbo:new_game(Pid, <<"8/8/8/2k5/8/8/1K2B3/8 w - - 0 1">>),
{ok,{draw,insufficient_material}} = binbo:game_status(Pid),

% White King and Bishop on dark square vs Black King
{ok,{draw,insufficient_material}} = binbo:new_game(Pid, <<"8/8/8/2k5/8/8/1K1B4/8 w - - 0 1">>),
{ok,{draw,insufficient_material}} = binbo:game_status(Pid),

% Black King and Bishop on light square vs White King
{ok,{draw,insufficient_material}} = binbo:new_game(Pid, <<"8/5b2/2k5/8/8/8/1K6/8 w - - 0 1">>),
{ok,{draw,insufficient_material}} = binbo:game_status(Pid),

% Black King and Bishop on dark square vs White King
{ok,{draw,insufficient_material}} = binbo:new_game(Pid, <<"8/4b3/2k5/8/8/8/1K6/8 w - - 0 1">>),
{ok,{draw,insufficient_material}} = binbo:game_status(Pid),

ok.

%% print_board_when_game_undefined
print_board_when_game_undefined(Config) ->
Pid = get_pid(Config),
Expand Down

0 comments on commit 59b455d

Please sign in to comment.