Next: (veritas impact), Previous: (veritas diff), Up: API
Generator combinators for the property-based testing subsystem. Every generator is a closure taking a random state, so the calling convention is always: (lambda (rand) ...). Sizes are picked inside the generator, which saves threading a size argument through the pipeline by hand.
A generator may also carry a shrinker: a procedure of one value that returns a list of smaller replacements, smallest first. A property uses it to walk a failing input down to the smallest value that still fails. Generators made by hand need no shrinker; they simply do not shrink.
Return a generator of beer styles.
Return a generator of #t and #f.
Return a generator of car makes and models.
Return a generator of printable ASCII characters, 32 to 126.
Return a generator that always answers value.
Return a generator of first.last@example.com email addresses.
Return a generator of first names.
Return a generator of integers between 0 and max-bound (exclusive).
Call the generator with a random state:
(define gen (generate-integer #:max-bound 100)) (gen (seed->random-state 42))
Return a generator of last names.
Return a generator of lists whose elements come from elem-generator.
Lists are min-len to max-len long.
Return a generator of full names, a first name and a last name.
Return a generator of integers between 0 and max-bound inclusive.
Return a generator that picks one of choices at random.
A choice is usually a constant, so there is nothing to shrink.
Return a generator of real numbers in the range min to max.
Return a generator of printable-ASCII strings.
Strings are min-len to max-len characters long.
Return a generator of lowercase symbols, min-len to max-len long.
Symbols stay unescaped because the characters are always a-z.
Return a generator of lists holding one value from each of generators.
Return a generator of vectors whose elements come from elem-generator.
Return smaller replacements for value taken from generator.
The list is smallest first, and is empty when the generator cannot shrink a value - a constant generator, or one a user wrote by hand.
Next: (veritas impact), Previous: (veritas diff), Up: API