function | previously cljs.spec/exercise | clojure.spec.alpha/exercise | Edit |
(exercise spec)
(exercise spec n)
(exercise spec n overrides)
generates a number (default 10) of values compatible with spec and maps conform over them, returning a sequence of [val conformed-val] tuples. Optionally takes a generator overrides map as per gen
(defn exercise
([spec] (exercise spec 10))
([spec n] (exercise spec n nil))
([spec n overrides]
(map #(vector % (conform spec %)) (gen/sample (gen spec overrides) n))))