Liking cljdoc? Tell your friends :D

convex.clj.gen

Generators for test.check.

Convex Lisp types and constructs expressed as Clojure data structures.

Useful for quickly writing sophisticated generative tests with the convex.clj namespace.

Generators for [test.check](https://github.com/clojure/test.check).

Convex Lisp types and constructs expressed as Clojure data structures.

Useful for quickly writing sophisticated generative tests with the [[convex.clj]] namespace.
raw docstring

addressclj

Any address.

Any address.
sourceraw docstring

anyclj

Any type from this namespace.

Any type from this namespace.
sourceraw docstring

any-butclj

(any-but exclusion-set)

Any type but from the given exclusion-set.

Any type but from the given `exclusion-set`.
sourceraw docstring

binding+clj

(binding+ n-min n-max)
(binding+ n-min n-max gen-value)

Vector of [ [[symbol]] [[any]] ] where symbols are garanteed to be unique.

Useful for generating let-like bindings.

Vector of `[ [[symbol]] [[any]] ]` where symbols are garanteed to be unique.

Useful for generating `let`-like bindings.
sourceraw docstring

blobclj

Any blob.

Any blob.
sourceraw docstring

blob-32clj

Like blob but fixed size representing 32 bytes.

Like [[blob]] but fixed size representing 32 bytes.
sourceraw docstring

blob-8clj

Like blob but fixed size representing 8 bytes.

Compatible with addresses.

Like [[blob]] but fixed size representing 8 bytes.

Compatible with addresses.
sourceraw docstring

booleanclj

True or false.

True or false.
sourceraw docstring

byteclj

Value between -128 and 127.

Value between -128 and 127.
sourceraw docstring

callclj

(call gen-sym gen-arg+)

Random call to a (~sym ~@arg+) form.

Random call to a `(~sym ~@arg+)` form.
sourceraw docstring

charclj

Any character

Any character
sourceraw docstring

collectionclj

Any collection.

Any collection.
sourceraw docstring

doubleclj

Any double, including +/- Infinity and NaN.

Any double, including +/- Infinity and NaN.
sourceraw docstring

falsyclj

Either false or nil.

Either false or nil.
sourceraw docstring

hex-digitclj

Any valid character for hexadecimal notation, from to .

Any valid character for hexadecimal notation, from `  ` to `  `.
sourceraw docstring

hex-stringclj

A valid hex-string where each byte is written as two hex-digit.

A valid hex-string where each byte is written as two [[hex-digit]].
sourceraw docstring

hex-string-32clj

Like hex-string but fixed size representing 32 bytes.

Like [[hex-string]] but fixed size representing 32 bytes.
sourceraw docstring

hex-string-8clj

Like hex-string but fixed size representing 8 bytes.

Compatible with addresses.

Like [[hex-string]] but fixed size representing 8 bytes.

Compatible with addresses.
sourceraw docstring

keywordclj

Any keyword.

Any keyword.
sourceraw docstring

kv+clj

(kv+ gen-k gen-v)

Vector of [Key Value].

Ensures that all the keys are distinct which might matter in test situations.

Vector of `[Key Value]`.

Ensures that all the keys are distinct which might matter in test situations.
sourceraw docstring

listclj

Any list.

Any list.
sourceraw docstring

longclj

Any long.

Any long.
sourceraw docstring

mapclj

Any hash-map (not blob-maps).

Any hash-map (not blob-maps).
sourceraw docstring

mix-one-inclj

(mix-one-in gen-one gen-coll)

Ensures that an item from gen-one is present and shuffled in the sequential collection produced by gen-coll.

Ensures that an item from `gen-one` is present and shuffled in the sequential collection produced by `gen-coll`.
sourceraw docstring

nothingclj

Always generated nil.

Always generated nil.
sourceraw docstring

numberclj

Either double or long

Either [[double]] or [[long]]
sourceraw docstring

number-boundedclj

(number-bounded option+)

Like number but accept a map with :min and :max for setting boundaries.

Both are optional.

Like [[number]] but accept a map with `:min` and `:max` for setting boundaries.

Both are optional.
sourceraw docstring

outlierclj

(outlier set-gen-good)
(outlier gen-good gen-wrong)

Produces a vector of items where each item is either a good item or anything else.

Ensures that at least one wrong item is produced.

Both kind can be given explicitly or a set of good generators can be given from which a "bad" generator can be deduced.

Useful for testing in order to produce inputs that are always faulty (at least partly).

Produces a vector of items where each item is either a good item or anything else.

Ensures that at least one wrong item is produced.

Both kind can be given explicitly or a set of good generators can be given from which
a "bad" generator can be deduced.

Useful for testing in order to produce inputs that are always faulty (at least partly).
sourceraw docstring

quotedclj

(quoted gen)

Quotes the value produced by gen such as (quote x).

Quotes the value produced by `gen` such as `(quote x)`.
sourceraw docstring

recursiveclj

Base generators for recursive Convex types where an item of a collection can be a collection as well.

Leaves are scalar while containes can be lists, maps, sets, and vectors.

Produces a scalar in roughly 10% of outputs.

Base generators for recursive Convex types where an item of a collection can be a collection as well.

Leaves are [[scalar]] while containes can be lists, maps, sets, and vectors.

Produces a scalar in roughly 10% of outputs.
sourceraw docstring

scalarclj

Any of:

- [[address]]
- [[blob]]
- [[boolean]]
- [[char]]
- [[double]]
- [[keyword]]
- [[long]]
- [[nothing]]
- [[string]]
- [[symbol-quoted]]
sourceraw docstring

sequentialclj

Either a list of a vector.

Either a list of a vector.
sourceraw docstring

setclj

Any set.

Any set.
sourceraw docstring

stringclj

Any string.

Any string.
sourceraw docstring

string-symbolicclj

Like string but can be used for building keywords and symbols.

Size is between 1 and 64 characters and the first character is compatible with symbolic types.

Like [[string]] but can be used for building keywords and symbols.

Size is between 1 and 64 characters and the first character is compatible with symbolic types.
sourceraw docstring

symbolclj

Any symbol.

Any symbol.
sourceraw docstring

symbol-quotedclj

Like symbol but the output is quoted.

Like [[symbol]] but the output is quoted.
sourceraw docstring

truthyclj

Any but falsy.

Any but [[falsy]].
sourceraw docstring

vectorclj

Any vector.

Any vector.
sourceraw docstring

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

× close