 
 (deftest test-undo-game
   (let [init-game (logic/new-game)
-        end-game  (play-moves init-game cst/coordinates)
+        end-game (play-moves init-game cst/coordinates)
         undo-game (reduce #(logic/on-undo %1) end-game cst/coordinates)]
     (is (logic/game-over? end-game))
     (is (= init-game undo-game))

;; Generative testing
;; ----------------------------------------------------------------------------

(defn valid-on-move-reaction
  [game-state]
  (prop/for-all [[x y] (gen/elements cst/coordinates)]
    (let [next-game-state (logic/on-move game-state x y)]
      (or
        (= (count-empty-cells game-state) (count-empty-cells next-game-state))
        (not= (logic/get-next-player game-state) (logic/get-next-player next-game-state))
        ))))

(defspec next-player-at-start
  100

  [value coll]
  (count-if #(= % value) coll))

(defn count-cells
  [cell-type game-state]
  (count-equal cell-type (get-cells game-state)))

(defn count-empty-cells
  [game-state]
  (count-cells :cell/empty game-state))

(defn play-moves
  [init-game moves]
