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->arbitrary a & args)
(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 & arbitrary-args)
Arbitrary function.
Arbitrary function.
(arbitrary-generator Arbitrary-type)
Access generator
field from a [[Arbitrary-type]] record. See active.quickcheck/make-arbitrary
.
Access `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-transformer Arbitrary-type)
Access transformer
field from a [[Arbitrary-type]] record. See active.quickcheck/make-arbitrary
.
Access `transformer` field from a [[Arbitrary-type]] record. See [[active.quickcheck/make-arbitrary]].
(arbitrary-tuple & arbitrary-els)
Arbitrary fixed-size vector.
Arbitrary fixed-size 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)
Access arguments-list
field from a [[Check-result-type]] record. See active.quickcheck/make-check-result
.
Access `arguments-list` field from a [[Check-result-type]] record. See [[active.quickcheck/make-check-result]].
(check-result-ok Check-result-type)
Access ok
field from a [[Check-result-type]] record. See active.quickcheck/make-check-result
.
Access `ok` field from a [[Check-result-type]] record. See [[active.quickcheck/make-check-result]].
(check-result-stamp Check-result-type)
Access stamp
field from a [[Check-result-type]] record. See active.quickcheck/make-check-result
.
Access `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 alphabetic letters.
Generator for ASCII alphabetic letters.
(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 arb val gen)
(coerce->generator thing)
Coerce an object to a generator.
Coerce an object to a generator.
(coll-of->arbitrary a & kwargs)
(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.
(fn->arbitrary fun)
(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.
(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 transformer)
Construct a Arbitrary-type
record.
generator
: access via active.quickcheck/arbitrary-generator
transformer
: access via active.quickcheck/arbitrary-transformer
Construct a `Arbitrary-type` record. `generator`: access via [[active.quickcheck/arbitrary-generator]] `transformer`: access via [[active.quickcheck/arbitrary-transformer]]
(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-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)
Access max-fail
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Access `max-fail` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config-max-test Config-type)
Access max-test
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Access `max-test` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config-print-every Config-type)
Access print-every
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Access `print-every` field from a [[Config-type]] record. See [[active.quickcheck/make-config]].
(make-config-size Config-type)
Access size
field from a [[Config-type]] record. See active.quickcheck/make-config
.
Access `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]]
(map-of->arbitrary ks vs)
(or->arbitrary & args)
(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)
Access func
field from a [[Promote-type]] record. See active.quickcheck/make-promote
.
Access `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)
Access arg-names
field from a [[Property-type]] record. See active.quickcheck/make-property
.
Access `arg-names` field from a [[Property-type]] record. See [[active.quickcheck/make-property]].
(property-args Property-type)
Access args
field from a [[Property-type]] record. See active.quickcheck/make-property
.
Access `args` field from a [[Property-type]] record. See [[active.quickcheck/make-property]].
(property-func Property-type)
Access func
field from a [[Property-type]] record. See active.quickcheck/make-property
.
Access `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)
(spec->arbitrary spec)
Make an arbitrary from a clojure spec
Make an arbitrary 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-op->arbitrary op args)
Make an arbitrary from a spec op
Make an arbitrary from a spec op
(such-that-generator gen pred)
(such-that-maybe gen pred)
(symbol->arbitrary sym)
(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)
Access gen
field from a [[Variant-type]] record. See active.quickcheck/make-variant
.
Access `gen` field from a [[Variant-type]] record. See [[active.quickcheck/make-variant]].
(variant-v Variant-type)
Access v
field from a [[Variant-type]] record. See active.quickcheck/make-variant
.
Access `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)
Access generator
field from a [[With-size-type]] record. See active.quickcheck/make-with-size
.
Access `generator` field from a [[With-size-type]] record. See [[active.quickcheck/make-with-size]].
(with-size-size With-size-type)
Access size
field from a [[With-size-type]] record. See active.quickcheck/make-with-size
.
Access `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