-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests.sh
More file actions
executable file
·56 lines (41 loc) · 1.93 KB
/
tests.sh
File metadata and controls
executable file
·56 lines (41 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
echo "Registering someguy and othergirl ..."
GET "127.0.0.1?messagetype=newuser&name=someguy" # registers as someguy
echo ""
GET "127.0.0.1?messagetype=newuser&name=othergirl" # registers as someguy
echo ""
GET "127.0.0.1?messagetype=newuser&name=otherguy" # registers as someguy
echo ""
echo ""
echo ""
echo "Get player list and pings ..."
GET "127.0.0.1?messagetype=get_players_list" # gets list of all users
echo ""
echo "{ \"messagetype\": \"ping\" }" | POST "127.0.0.1" # ping from unknown
echo ""
echo ""
echo ""
echo "All kinds of moves valid and invalid ..."
echo "{ \"messagetype\": \"newmove\" , \"startpos\": [5,6] , \"endpos\":[6,6] }" | POST "127.0.0.1" # move from "undefined" player
echo ""
echo "{ \"messagetype\": \"newmove\" , \"startpos\": [5,6] , \"endpos\":[6,6] ,\"player_id\":\"someguy\"} " | POST "127.0.0.1" # move from defined player but with empty cell
echo ""
echo "{ \"messagetype\": \"newmove\" , \"startpos\": [6,6] , \"endpos\":[5,6] ,\"player_id\":\"someguy\"} " | POST "127.0.0.1" # correct move on existing player
echo ""
echo "{ \"messagetype\": \"newmove\" , \"startpos\": [6,5] , \"endpos\":[4,5] ,\"player_id\":\"someguy\"} " | POST "127.0.0.1" # incorrect move on existing player
echo ""
echo ""
echo ""
echo ""
#echo "Now othergirl wants to play with someguy and someguy accepts the invitation"
echo "Invitations to start a match ..."
echo "{ \"messagetype\": \"requestMatch\" , \"player1\": \"othergirl\" , \"player2\": \"someguy\" }" | POST "127.0.0.1" # move from "undefined" player
echo ""
echo "{ \"messagetype\": \"acceptRequest\" , \"player\": \"someguy\" , \"requester\": \"othergirl\" }" | POST "127.0.0.1" # move from "undefined" player
echo ""
echo "{ \"messagetype\": \"requestMatch\" , \"player1\": \"otherguy\" , \"player2\": \"othergirl\" }" | POST "127.0.0.1" # move from "undefined" player
echo ""
echo ""
echo ""
echo ""
GET "http://127.0.0.1?messagetype=get_table_state&name=someguy"
echo "\n"