Fork me on GitHub
#clojure-spec
<
2017-03-05
>
michelrandahl17:03:01

how do you 're-use' a random seed for re-checking or re-generating test sample?

joshjones18:03:56

let's say you ran:

(stest/check `my-func)
which will return a map which has a :clojure.spec.test.check/ret {:result true :num-tests 100 :seed 123456789} To reuse this seed, run:
(stest/check `my-func {:clojure.spec.test.check/opts {:seed 123456789}})
this opts map also takes :num-tests which controls how many test are run, and :max-size, which constrains the size of the generated vals