summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-07-03 15:45:02 -0400
committerrsiddharth <s@ricketyspace.net>2020-07-03 15:45:02 -0400
commit899ab5e803a38e0ca4d84a245b3c0697f2fd613d (patch)
tree7b24848080e41a666b744cc30f378b9c95146a28
parent27aef5ad656b1a08edff51d26931b633fd81f553 (diff)
fourteen/server.rkt: Add tests for get-ips
-rw-r--r--net/ricketyspace/ror/fourteen/server.rkt16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/ricketyspace/ror/fourteen/server.rkt b/net/ricketyspace/ror/fourteen/server.rkt
index 21485a5..7a7f9ad 100644
--- a/net/ricketyspace/ror/fourteen/server.rkt
+++ b/net/ricketyspace/ror/fourteen/server.rkt
@@ -1000,6 +1000,22 @@ The server is responsible for:
empty
empty))
(list iworld1))
+
+ ;; get-ips
+ (let ([players (list (ip iworld1 "player10" (body 10 1+10i) empty)
+ (ip iworld2 "player345" (body 56 3+45i) empty))]
+ [spectators (list (ip iworld1 "player10" (body 15 2+65i) empty))])
+ (check-equal? (get-ips (play players
+ (list (body 87 67+23i)
+ (body 5 3+4i))
+ spectators))
+ (append players spectators))
+ (check-equal? (get-ips (play (list (first players))
+ (list (body 87 67+23i)
+ (body 5 3+4i))
+ empty))
+ (append (list (first players)) empty)))
+
;; broadcast
(check-equal? (broadcast (list iworld1 iworld3 iworld2)
'(testing testing 1 2 3))