This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-05
Channels
- # bangalore-clj (4)
- # beginners (16)
- # boot (4)
- # cljs-dev (1)
- # cljsrn (2)
- # clojure (177)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-russia (41)
- # clojure-spec (3)
- # clojure-uk (21)
- # clojurescript (46)
- # code-art (1)
- # datomic (10)
- # hoplon (125)
- # leiningen (1)
- # luminus (2)
- # lumo (1)
- # off-topic (10)
- # onyx (69)
- # re-frame (22)
- # reagent (4)
- # ring (32)
- # rum (6)
- # specter (2)
- # untangled (5)
how do you 're-use' a random seed for re-checking or re-generating test sample?
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