Fork me on GitHub
#test-check
<
2017-02-25
>
mss22:02:14

hey all, newbie test.check question. how would I go about creating a generator for something like java date objects? I’ve found obv clojure.data.generators/date, which produces random date objects. I’m missing how to utilize that fn to produce a generator I could use in e.g. specs

mss22:02:31

I can use return but from what I can tell from the documentation, the value returned by the call should always be the same, as opposed to something randomized

gfredericks23:02:22

@mss you can't use things in clojure.data.generators for test.check

gfredericks23:02:46

a super easy option is (gen/fmap #(java.util.Date. %) gen/large-integer)

gfredericks23:02:56

if you don't care about the distribution at all that will suffice

mss23:02:13

wonderful, thanks for the feedback