A QuickCheck clone for Clojure.
A QuickCheck clone for Clojure.
(==> ?bool ?prop)
Create a property that only has to hold when its prerequisite holds.
Create a property that only has to hold when its prerequisite holds.
(and->coarbitrary a & args)
Make a coarbitrary from a spec product
Make a coarbitrary from a spec product
(arbitrary form)
Convenient syntax for constructing arbitraries.
This is usually used implicitly via the property macro.
The argument form can be one of the following:
The syntax is extensible via the expand-arbitrary multimethod.
Convenient syntax for constructing arbitraries. This is usually used implicitly via the property macro. The argument form can be one of the following: - boolean, integer, byte, short, int, long, unsigned byte, unsigned-short, unsigned-int, unsigned-long natural, rational, float, char, ascii-char, printable-ascii-char, string, ascii-string, printable-ascii-string, byte-array, symbol, keyword - (one-of <equality> <expr> ...) - (tuple <arb> ...) - (list <arb>) - (vector <arb>) - (set <arb>) - (record <constructor> [<accessor> <arb> ...]) - (mixed <pred> <arb> <pred> <arb> ...) - (map <arb1> <arb2>) ; map with keys from <arb1>, values from <arb2> - ~<expr>, which evaluates <expr> as a regular expression The syntax is extensible via the expand-arbitrary multimethod.
Arbitrary string of ASCII characters.
Arbitrary string of ASCII characters.
(arbitrary-coll-of arbitrary-el & kwargs)
Arbitrary collection mimicking Clojure spec's coll-of
Arbitrary collection mimicking Clojure spec's coll-of
(arbitrary-function arbitrary-result & coarbitrary-args)
Arbitrary function.
Arbitrary function.
(arbitrary-generator Arbitrary-type)
Lens for the generator
field from a [[Arbitrary-type]] record. See active.quickcheck/make-arbitrary
.
Lens for the `generator` field from a [[Arbitrary-type]] record. See [[active.quickcheck/make-arbitrary]].
(arbitrary-integer-from-to from to)
Arbitrary integer from range.
Arbitrary integer from range.
(arbitrary-map arbitrary-key arbitrary-value)
Arbitrary map over the given arbitrary key and value.
Arbitrary map over the given arbitrary key and value.
(arbitrary-mixed pred+arbitrary-promise-list)
Arbitrary value from one of a list of (promises of) arbitraries.
Arbitrary value from one of a list of (promises of) arbitraries.
(arbitrary-one-of eql? & vals)
Arbitrary value from a list of values, and equality predicate.
Arbitrary value from a list of values, and equality predicate.
Arbitrary printable ASCII character.
Arbitrary printable ASCII character.
Arbitrary string of printable ASCII characters.
Arbitrary string of printable ASCII characters.
(arbitrary-record construct accessors & arbitrary-els)
Arbitrary record.
Arbitrary record.
(arbitrary-sequence-like choose-sequence sequence->list arbitrary-el)
Arbitrary sequence-like container.
Arbitrary sequence-like container.
(arbitrary-tuple & arbitrary-els)
Arbitrary fixed-size vector.
Arbitrary fixed-size vector.
(arbitrary-vector arbitrary-el)
Arbitrary vector.
Arbitrary vector.
(arbitrary? thing)
Is object a Arbitrary-type
record? See active.quickcheck/make-arbitrary
.
Is object a `Arbitrary-type` record? See [[active.quickcheck/make-arbitrary]].
(check config prop)
Run a property against a configuration and report results.
Run a property against a configuration and report results.
(check-result-arguments-list Check-result-type)
Lens for the arguments-list
field from a [[Check-result-type]] record. See active.quickcheck/make-check-result
.
Lens for the `arguments-list` field from a [[Check-result-type]] record. See [[active.quickcheck/make-check-result]].
(check-result-ok Check-result-type)
Lens for the ok
field from a [[Check-result-type]] record. See active.quickcheck/make-check-result
.
Lens for the `ok` field from a [[Check-result-type]] record. See [[active.quickcheck/make-check-result]].
(check-result-stamp Check-result-type)
Lens for the stamp
field from a [[Check-result-type]] record. See active.quickcheck/make-check-result
.
Lens for the `stamp` field from a [[Check-result-type]] record. See [[active.quickcheck/make-check-result]].
(check-result? thing)
Is object a Check-result-type
record? See active.quickcheck/make-check-result
.
Is object a `Check-result-type` record? See [[active.quickcheck/make-check-result]].
(check-results config prop)
Run a property against a configuration and return results.
Run a property against a configuration and return results.
Generator for ASCII characters.
Generator for ASCII characters.
Generator for ASCII alphabetic letters.
Generator for ASCII alphabetic letters.
Generator for bytes in [-128, 127].
Generator for bytes in [-128, 127].
(choose-byte-array n)
Generator for a byte array with size n.
Generator for a byte array with size n.
(choose-char lower upper)
Generator for chars within a range, bonds are inclusive.
Generator for chars within a range, bonds are inclusive.
(choose-float lower upper)
Generator for floats within a range, bounds are inclusive.
Generator for floats within a range, bounds are inclusive.
Generator for ints in [-2147483648, 2147483647].
Generator for ints in [-2147483648, 2147483647].
(choose-integer lower upper)
Generator for integers within a range, bounds are inclusive.
Generator for integers within a range, bounds are inclusive.
(choose-keyword n)
Generator for a keyword with size n+1.
Generator for a keyword with size n+1.
(choose-list el-gen n)
Generator for a list of values with size n.
Generator for a list of values with size n.
Generator for longs in [-9223372036854775808, 9223372036854775807].
Generator for longs in [-9223372036854775808, 9223372036854775807].
(choose-map el-gen n)
Generator for a map with size n. The passed element generator must generate key-value pairs.
Generator for a map with size n. The passed element generator must generate key-value pairs.
(choose-mixed gens)
Generator that chooses from a sequence of generators.
Generator that chooses from a sequence of generators.
(choose-one-of lis)
Make a generator that yields one of a list of values.
Make a generator that yields one of a list of values.
Generator for printable ASCII characters.
Generator for printable ASCII characters.
(choose-set el-gen n)
Generator for a set with size <= n
Generator for a set with size <= n
Generator for shorts in [-32768, 32767].
Generator for shorts in [-32768, 32767].
(choose-string char-gen n)
Generator for a string with size n.
Generator for a string with size n.
(choose-symbol n)
Generator for a symbol with size n+1.
Generator for a symbol with size n+1.
Generator for bytes in [0, 255].
Generator for bytes in [0, 255].
Generator for bytes in [0, 4294967295].
Generator for bytes in [0, 4294967295].
Generator for bytes in [0, 18446744073709551615].
Generator for bytes in [0, 18446744073709551615].
Generator for bytes in [0, 65535].
Generator for bytes in [0, 65535].
(choose-vector el-gen n)
Generator for a vector with size n.
Generator for a vector with size n.
(choose-with-frequencies lis)
Generator that chooses from a sequence of (frequency generator) pairs.
Generator that chooses from a sequence of (frequency generator) pairs.
(classify ?really? ?str ?testable)
Classify some test cases of a testable.
Classify some test cases of a testable.
Coarbitrary ASCII character.
Coarbitrary ASCII character.
Coarbitrary string of ASCII characters.
Coarbitrary string of ASCII characters.
(coarbitrary-coarbitrary Coarbitrary-type)
Lens for the coarbitrary
field from a [[Coarbitrary-type]] record. See active.quickcheck/make-coarbitrary
.
Lens for the `coarbitrary` field from a [[Coarbitrary-type]] record. See [[active.quickcheck/make-coarbitrary]].
(coarbitrary-coll-of arbitrary-el & kwargs)
Coarbitrary collection mimicking Clojure spec's coll-of
Coarbitrary collection mimicking Clojure spec's coll-of
(coarbitrary-function coarbitrary-result & arbitrary-args)
Coarbitrary function.
Coarbitrary function.
(coarbitrary-integer-from-to from to)
Coarbitrary integer from range.
Coarbitrary integer from range.
(coarbitrary-list coarbitrary-el)
Coarbitrary list.
Coarbitrary list.
(coarbitrary-map coarbitrary-key coarbitrary-value)
coarbitrary map over the given arbitrary key and value.
coarbitrary map over the given arbitrary key and value.
(coarbitrary-mixed pred+arbitrary-promise-list)
Arbitrary value from one of a list of (promises of) arbitraries.
Arbitrary value from one of a list of (promises of) arbitraries.
(coarbitrary-one-of eql? & vals)
Coarbitrary value from a list of values, and equality predicate.
Coarbitrary value from a list of values, and equality predicate.
Coarbitrary printable ASCII character.
Coarbitrary printable ASCII character.
Coarbitrary rational number.
Coarbitrary rational number.
(coarbitrary-record construct accessors & coarbitrary-els)
Coarbitrary record.
Coarbitrary record.
(coarbitrary-sequence-like choose-sequence sequence->list coarbitrary-el)
Coarbitr sequence-like container.
Coarbitr sequence-like container.
(coarbitrary-set coarbitrary-el)
Coarbitrary set.
Coarbitrary set.
Coarbitrary unsigned byte.
Coarbitrary unsigned byte.
Coarbitrary unsigned long.
Coarbitrary unsigned long.
Coarbitrary unsigned short.
Coarbitrary unsigned short.
(coarbitrary-vector coarbitrary-el)
Coarbitrary vector.
Coarbitrary vector.
(coarbitrary? thing)
Is object a Coarbitrary-type
record? See active.quickcheck/make-coarbitrary
.
Is object a `Coarbitrary-type` record? See [[active.quickcheck/make-coarbitrary]].
(coerce->generator thing)
Coerce an object to a generator.
Coerce an object to a generator.
(collect lbl testable)
Label a testable value with an the string representation of an object.
Label a testable value with an the string representation of an object.
Multimethod to expand `arbitrary' forms.
Dispatches on the symbol for atomic arbitrary forms, and on [op] for compound arbitrary forms, where op is the operator.
Multimethod to expand `arbitrary' forms. Dispatches on the symbol for atomic arbitrary forms, and on [op] for compound arbitrary forms, where op is the operator.
Multimethod to expand `coarbitrary' forms.
Dispatches on the symbol for atomic coarbitrary forms, and on [op] for compound coarbitrary forms, where op is the operator.
Multimethod to expand `coarbitrary' forms. Dispatches on the symbol for atomic coarbitrary forms, and on [op] for compound coarbitrary forms, where op is the operator.
(for-all func & args)
Bind names to generated values.
Bind names to generated values.
(for-all-with-names func arg-names args)
Bind names to generated values, supplying informative names.
Bind names to generated values, supplying informative names.
(gen->arbitrary gen)
Make a spec gen specification into an arbitrary.
Make a spec gen specification into an arbitrary.
(generate n rgen gen)
Extract a value from a generator, using size n and random generator rgen.
Extract a value from a generator, using size n and random generator rgen.
(generate-one-of arbs)
Randomly choose one of a list of given arbitraries
Randomly choose one of a list of given arbitraries
(get-random-generator? thing)
Is object a Get-random-generator-type
record? See active.quickcheck/make-get-random-generator
.
Is object a `Get-random-generator-type` record? See [[active.quickcheck/make-get-random-generator]].
(get-size? thing)
Is object a Get-size-type
record? See active.quickcheck/make-get-size
.
Is object a `Get-size-type` record? See [[active.quickcheck/make-get-size]].
(lift->generator func & gens)
Lift a function on values to generators.
Lift a function on values to generators.
(make-arbitrary generator)
Construct a Arbitrary-type
record.
generator
: access via active.quickcheck/arbitrary-generator
Construct a `Arbitrary-type` record. `generator`: access via [[active.quickcheck/arbitrary-generator]]
(make-check-result ok stamp arguments-list)
Construct a Check-result-type
record.
ok
: access via active.quickcheck/check-result-ok
stamp
: access via active.quickcheck/check-result-stamp
arguments-list
: access via active.quickcheck/check-result-arguments-list
Construct a `Check-result-type` record. `ok`: access via [[active.quickcheck/check-result-ok]] `stamp`: access via [[active.quickcheck/check-result-stamp]] `arguments-list`: access via [[active.quickcheck/check-result-arguments-list]]
(make-coarbitrary coarbitrary)
Construct a Coarbitrary-type
record.
coarbitrary
: access via active.quickcheck/coarbitrary-coarbitrary
Construct a `Coarbitrary-type` record. `coarbitrary`: access via [[active.quickcheck/coarbitrary-coarbitrary]]
(make-config max-test max-fail size print-every)
Construct a Config-type
record.
max-test
: access via active.quickcheck/make-config-max-test
max-fail
: access via active.quickcheck/make-config-max-fail
size
: access via active.quickcheck/make-config-size
print-every
: access via active.quickcheck/make-config-print-every
Construct a `Config-type` record. `max-test`: access via [[active.quickcheck/make-config-max-test]] `max-fail`: access via [[active.quickcheck/make-config-max-fail]] `size`: access via [[active.quickcheck/make-config-size]] `print-every`: access via [[active.quickcheck/make-config-print-every]]
(make-config-max-fail Config-type)
Lens for the max-fail
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Lens for the `max-fail` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config-max-test Config-type)
Lens for the max-test
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Lens for the `max-test` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config-print-every Config-type)
Lens for the print-every
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Lens for the `print-every` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config-size Config-type)
Lens for the size
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Lens for the `size` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config? thing)
Is object a Config-type
record? See active.quickcheck/make-config
.
Is object a `Config-type` record? See [[active.quickcheck/make-config]].
(make-get-random-generator)
Construct a Get-random-generator-type
record.
Construct a `Get-random-generator-type` record.
(make-get-size)
Construct a Get-size-type
record.
Construct a `Get-size-type` record.
(make-promote func)
Construct a Promote-type
record.
func
: access via active.quickcheck/promote-func
Construct a `Promote-type` record. `func`: access via [[active.quickcheck/promote-func]]
(make-property func arg-names args)
Construct a Property-type
record.
func
: access via active.quickcheck/property-func
arg-names
: access via active.quickcheck/property-arg-names
args
: access via active.quickcheck/property-args
Construct a `Property-type` record. `func`: access via [[active.quickcheck/property-func]] `arg-names`: access via [[active.quickcheck/property-arg-names]] `args`: access via [[active.quickcheck/property-args]]
(make-variant v gen)
Construct a Variant-type
record.
v
: access via active.quickcheck/variant-v
gen
: access via active.quickcheck/variant-generator
Construct a `Variant-type` record. `v`: access via [[active.quickcheck/variant-v]] `gen`: access via [[active.quickcheck/variant-generator]]
(make-with-size size generator)
Construct a With-size-type
record.
size
: access via active.quickcheck/with-size-size
generator
: access via active.quickcheck/with-size-generator
Construct a `With-size-type` record. `size`: access via [[active.quickcheck/with-size-size]] `generator`: access via [[active.quickcheck/with-size-generator]]
(pick n lis)
Pick an element from a sequence of (frequency, generator) pairs.
Pick an element from a sequence of (frequency, generator) pairs.
(promote-func Promote-type)
Lens for the func
field from a [[Promote-type]] record. See active.quickcheck/make-promote
.
Lens for the `func` field from a [[Promote-type]] record. See [[active.quickcheck/make-promote]].
(promote? thing)
Is object a Promote-type
record? See active.quickcheck/make-promote
.
Is object a `Promote-type` record? See [[active.quickcheck/make-promote]].
(property clauses body0 & bodies)
Create a property through binding identifiers to arbitraries.
The clauses are a vector of alternating identifiers and arbitraries, which are implicitly in the syntax understood by the arbitrary macro.
The body can use the identifiers, and should evaluate to a boolean saying whether the property is satisfied.
Create a property through binding identifiers to arbitraries. The clauses are a vector of alternating identifiers and arbitraries, which are implicitly in the syntax understood by the arbitrary macro. The body can use the identifiers, and should evaluate to a boolean saying whether the property is satisfied.
(property-arg-names Property-type)
Lens for the arg-names
field from a [[Property-type]] record. See active.quickcheck/make-property
.
Lens for the `arg-names` field from a [[Property-type]] record. See [[active.quickcheck/make-property]].
(property-args Property-type)
Lens for the args
field from a [[Property-type]] record. See active.quickcheck/make-property
.
Lens for the `args` field from a [[Property-type]] record. See [[active.quickcheck/make-property]].
(property-func Property-type)
Lens for the func
field from a [[Property-type]] record. See active.quickcheck/make-property
.
Lens for the `func` field from a [[Property-type]] record. See [[active.quickcheck/make-property]].
(property? thing)
Is object a Property-type
record? See active.quickcheck/make-property
.
Is object a `Property-type` record? See [[active.quickcheck/make-property]].
Quick test-run configuration with minimal output.
Quick test-run configuration with minimal output.
(quickcheck prop)
Run a property against the `quick' configuration and report results.
Run a property against the `quick' configuration and report results.
(quickcheck-results prop)
Run a property against the `quick' configuration and return results.
Run a property against the `quick' configuration and return results.
(set->arbitrary s)
Make an arbitrary from a set (behaviour like enum)
Make an arbitrary from a set (behaviour like enum)
(set->coarbitrary s)
Make a coarbitrary from a set (behaviour like enum)
Make a coarbitrary from a set (behaviour like enum)
(spec->arbitrary spec)
Make an arbitrary from a clojure spec
Make an arbitrary from a clojure spec
(spec->coarbitrary spec)
Make a coarbitrary from a clojure spec
Make a coarbitrary from a clojure spec
(spec-form->arbitrary form)
Make an arbitrary from a s/formed spec
Make an arbitrary from a s/formed spec
(spec-form->coarbitrary form)
Make a coarbitrary from a s/formed spec
Make a coarbitrary from a s/formed spec
(spec-op->arbitrary op args)
Make an arbitrary from a spec op
Make an arbitrary from a spec op
(spec-op->coarbitrary op args)
Make a coarbitrary from a spec op
Make a coarbitrary from a spec op
(such-that arb pred)
Takes a generator and a predicate and returns a new generator that satisfies the predicate.
Takes a generator and a predicate and returns a new generator that satisfies the predicate.
(trivial ?really? ?testable)
Classify some test cases of a testable as trivial.
Classify some test cases of a testable as trivial.
(variant-generator Variant-type)
Lens for the gen
field from a [[Variant-type]] record. See active.quickcheck/make-variant
.
Lens for the `gen` field from a [[Variant-type]] record. See [[active.quickcheck/make-variant]].
(variant-v Variant-type)
Lens for the v
field from a [[Variant-type]] record. See active.quickcheck/make-variant
.
Lens for the `v` field from a [[Variant-type]] record. See [[active.quickcheck/make-variant]].
(variant? thing)
Is object a Variant-type
record? See active.quickcheck/make-variant
.
Is object a `Variant-type` record? See [[active.quickcheck/make-variant]].
Quick test-run configuration with verbose output.
Quick test-run configuration with verbose output.
(with-size-generator With-size-type)
Lens for the generator
field from a [[With-size-type]] record. See active.quickcheck/make-with-size
.
Lens for the `generator` field from a [[With-size-type]] record. See [[active.quickcheck/make-with-size]].
(with-size-size With-size-type)
Lens for the size
field from a [[With-size-type]] record. See active.quickcheck/make-with-size
.
Lens for the `size` field from a [[With-size-type]] record. See [[active.quickcheck/make-with-size]].
(with-size? thing)
Is object a With-size-type
record? See active.quickcheck/make-with-size
.
Is object a `With-size-type` record? See [[active.quickcheck/make-with-size]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close