Skip to content

Commit

Permalink
test plains more
Browse files Browse the repository at this point in the history
  • Loading branch information
garbados committed Nov 9, 2023
1 parent ddc5a51 commit ee103cd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/the_longtime_game/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,26 @@
(range (count core/contacts)))]
(is (= (count (:contacts herd*)) (count core/contacts))))))

(deftest test-locations-across-seasons
(testing "Terrain across the seasons."
(let [herd
(reduce
(fn [herd _]
(let [old-season (core/get-season herd)]
(-> (update herd :month inc)
(core/inc-season old-season))))
(assoc (core/gen-herd) :path [(vec (map core/init-location core/terrains))])
(range 12))]
(is (s/valid? ::core/herd herd)))))

(deftest test-plains-enters-summer
(testing "Plains enters summer safely."
(let [location (core/init-location :plains)]
(testing "Field is fallow"
(let [location*
(->> (core/update-nutrients core/nutrients 1 location)
core/plains-enters-summer)]
(is (every? #(= 2 %) (map second (select-keys location* (seq core/nutrients)))))))
(testing "Crop is ready for harvest."
(let [location*
(core/plains-enters-summer
Expand Down

0 comments on commit ee103cd

Please sign in to comment.