Liking cljdoc? Tell your friends :D

schema.experimental.generators

(Very) experimental support for compiling schemas to test.check generators. To use it, you must provide your own test.check dependency.

TODO: add cljs support.

(Very) experimental support for compiling schemas to test.check generators.
To use it, you must provide your own test.check dependency.

TODO: add cljs support.
raw docstring

+primitive-generators+clj


+simple-leaf-generators+clj


alwaysclj

(always x)

CompositeGeneratorcljprotocol

composite-generatorclj

(composite-generator s params)

default-leaf-generatorsclj

(default-leaf-generators leaf-generators)

element-generatorclj

(element-generator e params)

elements-generatorclj

(elements-generator elts params)

enum-generatorsclj

(enum-generators s)

eq-generatorsclj

(eq-generators s)

fmapclj

(fmap f)

Helper wrapper that maps f over all values.

Helper wrapper that maps f over all values.
raw docstring

g-apply-byclj

(g-apply-by f args)

g-byclj

(g-by f & args)

generateclj

(generate & generator-args)

Inputs: [& generator-args]

Sample a single element of low to moderate size.

Inputs: [& generator-args]

Sample a single element of low to moderate size.
raw docstring

Generatorclj

A test.check generator

A test.check generator
raw docstring

generatorclj

(generator schema)
(generator schema leaf-generators)
(generator schema leaf-generators wrappers)

Inputs: ([schema] [schema leaf-generators] [schema :- Schema leaf-generators :- LeafGenerators wrappers :- GeneratorWrappers]) Returns: Generator

Produce a test.check generator for schema.

leaf-generators must return generators for all leaf schemas, and can also return generators for non-leaf schemas to override default generation logic.

constraints is an optional mapping from schema to wrappers for the default generators, which can impose constraints, fix certain values, etc.

Inputs: ([schema] [schema leaf-generators] [schema :- Schema leaf-generators :- LeafGenerators wrappers :- GeneratorWrappers])
Returns: Generator

Produce a test.check generator for schema.

 leaf-generators must return generators for all leaf schemas, and can also return
 generators for non-leaf schemas to override default generation logic.

 constraints is an optional mapping from schema to wrappers for the default generators,
 which can impose constraints, fix certain values, etc.
raw docstring

GeneratorWrappersclj

A mapping from schemas to wrappers that should be used around the default generators.

A mapping from schemas to wrappers that should be used around the default
generators.
raw docstring

LeafGeneratorsclj

A mapping from schemas to generating functions that should be used.

A mapping from schemas to generating functions that should be used.
raw docstring

mergedclj

(merged m)

Helper wrapper that merges some keys into a schema

Helper wrapper that merges some keys into a schema
raw docstring

sampleclj

(sample k & generator-args)

Inputs: [k & generator-args] Returns: [s/Any]

Sample k elements from generator.

Inputs: [k & generator-args]
Returns: [s/Any]

Sample k elements from generator.
raw docstring

Schemaclj

A Schema for Schemas

A Schema for Schemas
raw docstring

such-thatclj

(such-that f)

Helper wrapper that filters to values that match predicate.

Helper wrapper that filters to values that match predicate.
raw docstring

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

× close