From 4f731f11be9d5bbfcd921671852e514e577a0c00 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Fri, 3 Jul 2020 15:45:28 -0400 Subject: fourteen/server.rkt: Add tests for serialize-players-for. --- net/ricketyspace/ror/fourteen/server.rkt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'net/ricketyspace') diff --git a/net/ricketyspace/ror/fourteen/server.rkt b/net/ricketyspace/ror/fourteen/server.rkt index 7a7f9ad..078533b 100644 --- a/net/ricketyspace/ror/fourteen/server.rkt +++ b/net/ricketyspace/ror/fourteen/server.rkt @@ -1048,4 +1048,18 @@ The server is responsible for: (check-equal? (broadcast-universe state) (broadcast-universe state))) + ;; serialize-players-for + (let* ([waypoints1 (list (make-rectangular 383 212) + (make-rectangular 282 192))] + [waypoints2 (list (make-rectangular 918 319) + (make-rectangular 481 119) + (make-rectangular 129 321))] + [pls (list (ip iworld1 "player10" (body 10 1+10i) waypoints1) + (ip iworld2 "player345" (body 56 3+45i) waypoints2))] + [pl (first pls)]) + (check-equal? (player-waypoints (first (serialize-players-for pl pls))) + waypoints1) + (check-equal? (player-waypoints (second (serialize-players-for pl pls))) + (list (make-rectangular 918 319)))) + "server: all tests run") -- cgit v1.2.3