 ;; Generative testing
 ;; ----------------------------------------------------------------------------
 
-(defn valid-next-game?
+(defn valid-game-transition?
   [old-game new-game move]
   (let [new-player (logic/get-next-player new-game)
         old-player (logic/get-next-player old-game)

;; - The test should be based on visible API only: it means we should not
;; try to generate the internal state of the game. It would breach
;; encapsulation, and would thus break at any implementation change.
(def coord-gen
  (gen/elements cst/coordinates))

(def game-gen
  (gen/fmap
    #(play-moves (logic/new-game) %)
    (gen/vector coord-gen 0 cst/cell-count)
    ))

;; The following are all bad ideas

(def player-gen
  (gen/elements #{:cell/cross :cell/circle}))

        ))))

(defspec try-move-from-start-game 100
  (game-move-properties (logic/new-game)))

(defspec try-move-from-valid-game 100
  (prop/for-all [g game-gen] (game-move-properties g)))

(defspec try-undo-from-valid-game 100
  (prop/for-all [g game-gen] (game-undo-properties g)))


;; ----------------------------------------------------------------------------
