Sub-module containing the Investigator type used by elm-check.
This sub-module contains several predefined investigator generators and means of composing them to create your own. Note that most generators provided are only well-suited to local development. Property-based testing is by its nature a very slow process and is best paired with some sort of continuous integration service. Consider making your own, more general investigator generators when migrating from local to cloud-based.
An Investigator type is a Random Generator paired with a shrinking strategy,
or Shrinker. Shrinkers are defined in elm-shrink.
Investigator constructor. Construct an Investigator from a generator and a shrinker.
Investigator void. Uses a constant generator and the void shrinker from
elm-shrink.
Investigator bool. Uses the bool generator from elm-random-extra and the
bool shrinker from elm-shrink.
Investigator order. Uses the order generator from elm-random-extra and the
order shrinker from elm-shrink.
Extract a Random Generator from and an Investigator generator.
Investigator int. Generates random ints between -50 and 50 and the int
shrinker from elm-shrink. Ideal for local testing.
Investigator int constructor. Generates random ints between a given min
and a given max value.
Investigator float. Generates random floats between -50 and 50 and the float
shrinker from elm-shrink. Ideal for local testing.
Investigator percentage. Generates random floats between 0.0 and 1.0 and the float
shrinker from elm-shrink. Useful in conjunction with tuple to facilitate
things like generating an array and then selecting one of its elements at random.
Investigator char. Generates random ascii chars disregarding the control
characters using the char 32 127 generator from elm-random-extra and the
character shrinker from elm-shrink. Ideal for local testing or if your
domain deals exclusively with ascii and you do not care about control
characters.
Investigator char. Generates random ascii chars using the upperCaseLatin
generator from elm-random-extra and the character shrinker from elm-shrink.
Investigator char. Generates random ascii chars using the lowerCaseLatin
generator from elm-random-extra and the character shrinker from elm-shrink.
Investigator char. Generates random ascii chars using the ascii generator
from elm-random-extra and the char shrinker from elm-shrink. Ideal for local
testing or if your domain deals exclusively with ascii.
Investigator char. Generates a random UTF-8 character using the
unicode generator from elm-random-extra and the char shrinker from
elm-shrink.
Investigator string. Generates random ascii strings of size between 0 and 10
using the rangeLengthString generator from elm-random-extra and the string
shrinker from elm-shrink. Ideal for local testing.
Investigator maybe constructor. Generates random maybe values from a given
investigator generator using the maybe generator constructor from
elm-random-extra and the maybe shrinker constructor from elm-shrink.
Investigator result constructor. Generates random result values from a given
investigator generator using the result generator constructor from
elm-random-extra and the result shrinker constrctor from elm-shrink.
Investigator list constructor. Generates random lists of values of size
between 0 and 10 from a given investigator generator using the rangeLengthList
generator constructor from elm-random-extra and the list shrinker constructor
from elm-shrink. Ideal for local testing.
Investigator array constructor. Generates random arrays of values of size
between 0 and 10 from a given investigator generator using the rangeLengthArray
generator constructor from elm-random-extra and the array shrinker constructor
from elm-shrink. Ideal for local testing.
Investigator 2-tuple constructor. Generates random 2-tuples from a 2-tuple
of investigator generators. Uses the tuple shrinker constructor from elm-shrink.
Investigator 3-tuple constructor. Generates random 3-tuples from a 3-tuple
of investigator generators. Uses the tuple3 shrinker constrctor from elm-shrink.
Investigator 4-tuple constructor. Generates random 4-tuples from a 4-tuple
of investigator generators. Uses the tuple4 shrinker constrctor from elm-shrink.
Investigator 5-tuple constructor. Generates random 5-tuples from a 5-tuple
of investigator generators. Uses the tuple5 shrinker constrctor from elm-shrink.
Investigator of functions. Takes an investigator for the return type
and returns an investigator of functions. Uses the func generator from
elm-random-extra and does not perform any shrinking.
Shrink a value from an Investigator generator.