Fork me on GitHub
#test-check
<
2019-08-02
>
kenny18:08:45

Is there a way to create a generator from a list of generators such that when it generates, it returns the same list with each element in the list generated?

kenny18:08:12

Something like this:

(gen/let [my-things (map (fn [thing]
                           (get-gen-for thing))
                         my-things)])

gfredericks18:08:23

@kenny is this different from (apply gen/tuple ...)?

kenny18:08:01

Wow, so obvious haha. That's exactly it. Thanks 🙂

👍 4
Alex Miller (Clojure team)18:08:19

or just s/gen of an s/tuple if you're using spec