summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-07-03 15:45:28 -0400
committerrsiddharth <s@ricketyspace.net>2020-07-03 15:45:28 -0400
commit4f731f11be9d5bbfcd921671852e514e577a0c00 (patch)
tree75bfb276244934b7783d3b4e00dd836e5cbf11eb
parent899ab5e803a38e0ca4d84a245b3c0697f2fd613d (diff)
fourteen/server.rkt: Add tests for serialize-players-for.
-rw-r--r--net/ricketyspace/ror/fourteen/server.rkt14
1 files changed, 14 insertions, 0 deletions
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")