Skip to main content

map

function

clojure.test.check.generators/map

(map [key-gen val-gen] [key-gen val-gen opts])
Creates a generator that generates maps, with keys chosen from `key-gen` and values chosen from `val-gen`. If the key generator cannot or is unlikely to produce enough distinct elements, this generator will fail in the same way as `such-that`. Available options: :num-elements the fixed size of generated maps :min-elements the min size of generated maps :max-elements the max size of generated maps :max-tries the number of times the generator will be tried before failing when it does not produce distinct elements (default 10) :ex-fn a function of one arg that will be called if test.check cannot generate enough distinct keys; it will be passed a map with `:gen` (the key-gen), `:num-elements`, and `:max-tries` and should return an exception

No examples yet. Be the first to add one!