|
@@ -147,4 +147,10 @@
|
|
(is (not (get-in new-state [:players 0 :dead?])))
|
|
(is (not (get-in new-state [:players 0 :dead?])))
|
|
(is (= [scared-bomb] (:bombs new-state)))
|
|
(is (= [scared-bomb] (:bombs new-state)))
|
|
(is (= #{[1 2] [2 1] [2 3] [3 4] [4 5]}
|
|
(is (= #{[1 2] [2 1] [2 3] [3 4] [4 5]}
|
|
- (:explosion new-state))))))
|
|
|
|
|
|
+ (:explosion new-state)))))
|
|
|
|
+ (testing "Ticking bombs"
|
|
|
|
+ (let [state {:board (new-board 7 7)
|
|
|
|
+ :players []
|
|
|
|
+ :bombs [{:pos [1 1] :counter 2}]}
|
|
|
|
+ new-state (perform-bomb-tick state)]
|
|
|
|
+ (is (= 1 (get-in new-state [:bombs 0 :counter]))))))
|