Skip to main content

scale

function

clojure.test.check.generators/scale

(scale [f generator])
Creates a new generator that modifies the size parameter by the given function. Intended to support generators with sizes that need to grow at different rates compared to the normal linear scaling. (gen/sample (gen/tuple (gen/scale #(/ % 10) gen/nat) gen/nat (gen/scale #(* % 10) gen/nat))) => ([0 0 0] [0 1 2] [0 2 13] [0 1 6] [0 1 23] [0 2 42] [0 1 26] [0 1 12] [0 1 12] [0 0 3])

No examples yet. Be the first to add one!