test-check

2017-02-25T22:08:14.000192Z

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

2017-02-25T22:30:31.000193Z

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

2017-02-25T23:07:22.000194Z

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

2017-02-25T23:07:46.000195Z

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

2017-02-25T23:07:56.000196Z

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

2017-02-25T23:10:13.000197Z

wonderful, thanks for the feedback

2017-02-25T23:10:18.000198Z

np