Fork me on GitHub
#clojure-spec
<
2019-05-19
>
Jakub Holý (HolyJak)20:05:39

how do you do generative testing with spec? I now use

(defspec xyz
  100
  (prop/for-all [v (s/gen ::my-spec), res (myfn  v)]
    (do (s/assert ::my-result res)
          (my-check-some-property-on v res))))
but shouldn't s/exercise-fn be usable for this? Though, contrary to s/gen it doesn't allow me to specify overrides and thus test more special / infrequent cases?