File tree Expand file tree Collapse file tree
test/hyperspace/test/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 (is (= (:players world1) [player1
6464 (assoc player2
6565 :status :dead )]) " player 2 should be dead" )
66- (is (= targets [nil player2]))))))
66+ (is (= targets [player2 nil ]))))))
6767
6868(deftest planet-shot-test
6969 (let [game (game/create 800 600 )
7070 world (:world @game)
7171 player1id " player1"
7272 player2id " player2"
7373 planet (first (:planets world))
74+ single-planet-world (assoc world :planets [planet])
7475 players (:players world)
7576 player1 (first players)
7677 player2 (second players)
7980 (game/add-player game player1id)
8081 (game/add-player game player2id)
8182 (await game)
82- (let [[world1 targets] (game/process-turn @game [world []] [player1id turn1])]
83- (is (= world1 world) " world should not change" )
83+ (let [[world1 targets] (game/process-turn @game [single-planet- world []] [player1id turn1])]
84+ (is (= world1 single-planet- world) " world should not change" )
8485 (is (= targets [planet])))))
8586
8687(deftest player-shot-test
8788 (let [game (game/create 800 600 )
88- world (:world @game)
89+ world (-> (:world @game)
90+ (assoc :planets []))
8991 player1id " player1"
9092 player2id " player2"
9193 planet (first (:planets world))
You can’t perform that action at this time.
0 commit comments