X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test;h=b5be7d8fa20e27142a8acbdb719e950a22b7acf5;hb=32420152e7e4805104d5118fabc5ada0e668e5ae;hp=30dbe7f2781cd292de35b2b4112862f11af992c3;hpb=d6817ef860a230cbbb694e729a400ed37ed43d68;p=empires-server diff --git a/test b/test index 30dbe7f..b5be7d8 100755 --- a/test +++ b/test @@ -268,5 +268,26 @@ players=$(empires_players_string) test "$players" = "" TEST_END +TEST_SECTION "Tic Tac Toe game" + +tictactoe_game_path=tictactoe/$tictactoe_game_id + +tictactoe_move() +{ + curl_post $tictactoe_game_path/move "{\"square\": $1}" +} + +TEST_SUBSECTION "Tic Tac Toe /move" + +TEST "Move to the center square" +result=$(tictactoe_move 4) +test "$result" = "true" +TEST_END + +TEST "Move to center square again is now illegal" +result=$(tictactoe_move 4) +test "$result" = "false" +TEST_END + TEST_REPORT