From 83b82c646adf5bd2c9e96caf8f4f99dc0eb7f19e Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 5 Jul 2020 22:35:59 -0700 Subject: [PATCH] test: Add testing for a move that sends you to a full mini-grid In this case, it's legal to move anywhere, (the normal constraint of having to move to a matching mini-square is waived since it's impossible by definition). --- test | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test b/test index 8659c64..bcf3e3f 100755 --- a/test +++ b/test @@ -577,6 +577,45 @@ result=$(scribe_move '[0,8]') test "$result" = '{"legal":true}' TEST_END +TEST "Several moves to fill up the mini-grid 0" +scribe_set_player_team o +scribe_move '[3,0]' >/dev/null +scribe_set_player_team + +scribe_move '[8,0]' >/dev/null +scribe_set_player_team o +scribe_move '[0,0]' >/dev/null +scribe_set_player_team + +scribe_move '[0,1]' >/dev/null +scribe_set_player_team o +scribe_move '[0,2]' >/dev/null +scribe_set_player_team + +scribe_move '[1,0]' >/dev/null +scribe_set_player_team o +scribe_move '[2,0]' >/dev/null +scribe_set_player_team + +scribe_move '[0,5]' >/dev/null +scribe_set_player_team o +scribe_move '[0,6]' >/dev/null +scribe_set_player_team + +scribe_move '[5,0]' >/dev/null +scribe_set_player_team o +scribe_move '[6,0]' >/dev/null +scribe_set_player_team + +scribe_move '[0,7]' >/dev/null +scribe_set_player_team o +scribe_move '[0,4]' >/dev/null +scribe_set_player_team + +result=$(scribe_move '[7,0]') +test "$result" = '{"legal":true}' +TEST_END + +TEST "Full mini grid allows a free move" +scribe_set_player_team o +scribe_move '[4,1]' >/dev/null +scribe_set_player_team + +result=$(scribe_move '[1,1]') +test "$result" = '{"legal":true}' +TEST_END TEST_SECTION "Empathy game" -- 2.43.0