Liking cljdoc? Tell your friends :D

clojure.data.generators

Data generators for Clojure.

Data generators for Clojure.
raw docstring

*rnd*clj

Random instance for use in generators. By consistently using this instance you can get a repeatable basis for tests.

Random instance for use in generators. By consistently using this
instance you can get a repeatable basis for tests.
sourceraw docstring

anythingclj

(anything)

Returns a scalar or collection based on rnd.

Returns a scalar or collection based on *rnd*.
sourceraw docstring

bigdecclj

(bigdec)
source

bigintclj

(bigint)
source

booleanclj

(boolean)

Returns a bool based on rnd.

Returns a bool based on *rnd*.
sourceraw docstring

boolean-arrayclj

(boolean-array f)
(boolean-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

byteclj

(byte)

Returns a long based on rnd in the byte range.

Returns a long based on *rnd* in the byte range.
sourceraw docstring

byte-arrayclj

(byte-array f)
(byte-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

charclj

(char)

Returns a character based on rnd in the range 0-65536.

Returns a character based on *rnd* in the range 0-65536.
sourceraw docstring

char-arrayclj

(char-array f)
(char-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

collectionclj

(collection)

Returns a collection of scalar elements based on rnd.

Returns a collection of scalar elements based on *rnd*.
sourceraw docstring

collectionsclj

source

dateclj

(date)
(date base)

Create a date with geometric mean around base which defaults to #inst "2007-10-16T00:00:00.000-00:00"

Create a date with geometric mean around base which defaults to
#inst "2007-10-16T00:00:00.000-00:00"
sourceraw docstring

default-sizerclj

(default-sizer)

Default sizer used to run tests. If you want a specific distribution, create your own and pass it to a fn that wants a sizer.

Default sizer used to run tests. If you want a specific distribution,
create your own and pass it to a fn that wants a sizer.
sourceraw docstring

doubleclj

(double)

Generate a double between 0 and 1 based on rnd.

Generate a double between 0 and 1 based on *rnd*.
sourceraw docstring

double-arrayclj

(double-array f)
(double-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

floatclj

(float)

Generate a float between 0 and 1 based on rnd

Generate a float between 0 and 1 based on *rnd*
sourceraw docstring

float-arrayclj

(float-array f)
(float-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

geometricclj

(geometric p)

Geometric distribution with mean 1/p.

Geometric distribution with mean 1/p.
sourceraw docstring

hash-mapclj

(hash-map fk fv)
(hash-map fk fv sizer)

Create a hash-map with keys from fk, vals from fv, and sized from sizer.

Create a hash-map with keys from fk, vals from fv, and
sized from sizer.
sourceraw docstring

intclj

(int)

Returns a int based on rnd in the int range.

Returns a int based on *rnd* in the int range.
sourceraw docstring

int-arrayclj

(int-array f)
(int-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

keywordclj

(keyword)
(keyword sizer)

Create a non-namespaced keyword sized from sizer.

Create a non-namespaced keyword sized from sizer.
sourceraw docstring

listclj

(list f)
(list f sizer)

Create a list with elements from f and sized from sizer.

Create a list with elements from f and sized from sizer.
sourceraw docstring

longclj

Returns a long based on rnd. Same as uniform.

Returns a long based on *rnd*. Same as uniform.
sourceraw docstring

long-arrayclj

(long-array f)
(long-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

one-ofclj

(one-of & specs)

Generates one of the specs passed in, with equal probability.

Generates one of the specs passed in, with equal probability.
sourceraw docstring

primitive-arraycljmacro

(primitive-array type)
source

primitive-arrayscljmacro

(primitive-arrays types)
source

printable-ascii-charclj

(printable-ascii-char)

Returns a char based on rnd in the printable ascii range.

Returns a char based on *rnd* in the printable ascii range.
sourceraw docstring

rand-nthclj

(rand-nth coll)

Replacement of core/rand-nth that allows control of the randomization basis (through binding rnd).

Replacement of core/rand-nth that allows control of the
randomization basis (through binding *rnd*).
sourceraw docstring

ratioclj

(ratio)
(ratio num-gen denom-gen)

Generate a ratio, with numerator and denominator uniform longs or as specified

Generate a ratio, with numerator and denominator uniform longs
or as specified
sourceraw docstring

repsclj

(reps sizer f)

Returns sizer repetitions of f (or (f) if f is a fn).

Returns sizer repetitions of f (or (f) if f is a fn).
sourceraw docstring

reservoir-sampleclj

(reservoir-sample ct coll)

Reservoir sample ct items from coll, using rnd.

Reservoir sample ct items from coll, using *rnd*.
sourceraw docstring

scalarclj

(scalar)

Returns a scalar based on rnd.

Returns a scalar based on *rnd*.
sourceraw docstring

scalarsclj

source

setclj

(set f)
(set f sizer)

Create a set with elements from f and sized from sizer.

Create a set with elements from f and sized from sizer.
sourceraw docstring

shortclj

(short)

Returns a short based on rnd in the short range.

Returns a short based on *rnd* in the short range.
sourceraw docstring

short-arrayclj

(short-array f)
(short-array f sizer)

Create an array with elements from f and sized from sizer.

Create an array with elements from f and sized from sizer.
sourceraw docstring

shuffleclj

(shuffle coll)

Shuffle coll based on rnd

Shuffle coll based on *rnd*
sourceraw docstring

stringclj

(string)
(string f)
(string f sizer)

Create a string with chars from f and sized from sizer.

Create a string with chars from f and sized from sizer.
sourceraw docstring

symbolclj

(symbol)
(symbol sizer)

Create a non-namespaced symbol sized from sizer.

Create a non-namespaced symbol sized from sizer.
sourceraw docstring

tupleclj

(tuple & generators)

Generate a tuple with one element from each generator.

Generate a tuple with one element from each generator.
sourceraw docstring

uniformclj

(uniform)
(uniform lo hi)

Uniform distribution from lo (inclusive) to hi (exclusive). Defaults to range of Java long.

Uniform distribution from lo (inclusive) to hi (exclusive).
Defaults to range of Java long.
sourceraw docstring

uuidclj

(uuid)

Create a UUID based on uniform distribution of low and high parts.

Create a UUID based on uniform distribution of low and high parts.
sourceraw docstring

vecclj

(vec f)
(vec f sizer)

Create a vec with elements from f and sized from sizer.

Create a vec with elements from f and sized from sizer.
sourceraw docstring

weightedclj

(weighted m)

Given a map of generators and weights, return a value from one of the generators, selecting generator based on weights.

Given a map of generators and weights, return a value from one of
the generators, selecting generator based on weights.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close