Skip to main content

vector-distinct

function

clojure.test.check.generators/vector-distinct

(vector-distinct [gen] [gen opts])
Generates a vector of elements from the given generator, with the guarantee that the elements will be distinct. If the 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 vectors :min-elements the min size of generated vectors :max-elements the max size of generated vectors :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 values; it will be passed a map with `:gen`, `:num-elements`, and `:max-tries` and should return an exception

No examples yet. Be the first to add one!