A wrapper type for range types
Generator parameters, used by org.scalacheck.Gen.apply
Provides implicit org.scalacheck.Gen.Choose instances
Provides methods for creating org.scalacheck.Gen.Parameters values
Generates an alpha character
Generates a lower-case alpha character
Generates a string of lower-case alpha characters
Generates an alphanumerical character
Generates a string of alphanumerical characters
Generates a string of alpha characters
Generates an upper-case alpha character
Generates a string of upper-case alpha characters
Generates a ASCII character, with extra weighting for printable characters
Generates a ASCII printable character
Generates a string of ASCII printable characters
Generates a string of ASCII characters, with extra weighting for printable characters
A generator that picks at least one element from a list
A generator that picks at least one element from a list
Generates Int values according to the given binomial distribution, specified by the number of trials to conduct, and the probability of a true test.
Generates Int values according to the given binomial distribution, specified by the number of trials to conduct, and the probability of a true test.
This distribution counts the number of trials which were successful according to a given test probability.
The range of values is [0, trials].
Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance.
Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance. The elements in the container will be generated by the given generator. The size of the container is bounded by the size parameter used when generating values.
Generates a container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance.
Generates a container of any Traversable type for which there exists an
implicit org.scalacheck.util.Buildable instance. The elements in the
container will be generated by the given generator. The size of the
generated container is limited by n
. Depending on what kind of container
that is generated, the resulting container may contain fewer elements than
n
, but not more. If the given generator fails generating a value, the
complete container generator will also fail.
A generator that generates a random value in the given (inclusive) range.
A generator that generates a random value in the given (inclusive) range. If the range is invalid, an IllegalBoundsError exception will be thrown.
Generates numbers within the given inclusive range, with extra weight on zero, +/- unity, both extremities, and any special numbers provided.
Generates numbers within the given inclusive range, with extra weight on zero, +/- unity, both extremities, and any special numbers provided. The special numbers must lie within the given range, otherwise they won't be included.
A generator that always generates the given value
A convenience method for calling buildableOf[C[T],T](g)
.
A convenience method for calling buildableOfN[C[T],T](n,g)
.
Wraps a generator for later evaluation.
Wraps a generator for later evaluation. The given parameter is evaluated each time the wrapper generator is evaluated.
Generate a Double uniformly-distributed in [0, 1).
Generate a Double uniformly-distributed in [0, 1).
This method will generate one of 2^53 distinct Double values in the unit interval.
Generates instance of Duration.
Generates instance of Duration.
In addition to FiniteDuration
values, this can generate Duration.Inf
,
Duration.MinusInf
, and Duration.Undefined
.
Generates a Left
of T
or a Right
of U
with equal probability.
Generates Double values according to the given exponential distribution, specified by its rate parameter.
Generates Double values according to the given exponential distribution, specified by its rate parameter.
The mean and standard deviation are both equal to 1/rate.
The range of values is [0, ∞).
A generator that never generates a value
Implicit convenience method for using the frequency
method
like this:
Implicit convenience method for using the frequency
method
like this:
frequency((1, "foo"), (3, "bar"))
Chooses one of the given generators with a weighted random distribution
Creates a Function0 generator.
Gen creator for Function1
Gen creator for Function1
Gen creator for Function10
Gen creator for Function10
Gen creator for Function11
Gen creator for Function11
Gen creator for Function12
Gen creator for Function12
Gen creator for Function13
Gen creator for Function13
Gen creator for Function14
Gen creator for Function14
Gen creator for Function15
Gen creator for Function15
Gen creator for Function16
Gen creator for Function16
Gen creator for Function17
Gen creator for Function17
Gen creator for Function18
Gen creator for Function18
Gen creator for Function19
Gen creator for Function19
Gen creator for Function2
Gen creator for Function2
Gen creator for Function20
Gen creator for Function20
Gen creator for Function21
Gen creator for Function21
Gen creator for Function22
Gen creator for Function22
Gen creator for Function3
Gen creator for Function3
Gen creator for Function4
Gen creator for Function4
Gen creator for Function5
Gen creator for Function5
Gen creator for Function6
Gen creator for Function6
Gen creator for Function7
Gen creator for Function7
Gen creator for Function8
Gen creator for Function8
Gen creator for Function9
Gen creator for Function9
Generates Double values according to the given gaussian distribution, specified by its mean and standard deviation.
Generates Double values according to the given gaussian distribution, specified by its mean and standard deviation.
Gaussian distributions are also called normal distributions.
The range of values is theoretically (-∞, ∞) but 99.7% of all values will be contained within (mean ± 3 * stdDev).
Generates Int values according to the given geometric distribution, specified by its mean.
Generates Int values according to the given geometric distribution, specified by its mean.
This distribution represents the expected number of failures before a successful test, where the probability of a successful test is p = 1 / (mean + 1).
The ideal range of values is [0, ∞), although the largest value that can be produced here is 2147483647 (Int.MaxValue).
Generates a character that can represent a valid hexadecimal digit.
Generates a character that can represent a valid hexadecimal digit. This includes both upper and lower case values.
Generates a string that can represent a valid hexadecimal digit.
Generates a string that can represent a valid hexadecimal digit. This includes both upper and lower case values.
Generates a string that starts with a lower-case alpha character, and only contains alphanumerical characters
Generates an infinite stream.
Generates an infinite stream.
Failures in the underlying generator may terminate the stream. Otherwise it will continue forever.
Generates a list of random length.
Generates a list of random length. The maximum length depends on the
size parameter. This method is equal to calling
containerOf[List,T](g)
.
Generates a list with at most the given number of elements.
Generates a list with at most the given number of elements. This method
is equal to calling containerOfN[List,T](n,g)
.
Generate a uniformly-distributed Long.
Generate a uniformly-distributed Long.
This method has an equally likely method of generating every possible Long value.
Wraps a generator lazily.
Wraps a generator lazily. The given parameter is only evaluated once, and not until the wrapper generator is evaluated.
Generates a map of random length.
Generates a map of random length. The maximum length depends on the
size parameter. This method is equal to calling
containerOf[Map,(T,U)](g)
.
Generates a map with at most the given number of elements.
Generates a map with at most the given number of elements. This method
is equal to calling containerOfN[Map,(T,U)](n,g)
.
Generates negative numbers of uniform distribution, with an lower bound of the negated generation size parameter.
Generates a non-empty container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance.
Generates a non-empty container of any Traversable type for which there exists an implicit org.scalacheck.util.Buildable instance. The elements in the container will be generated by the given generator. The size of the container is bounded by the size parameter used when generating values.
A convenience method for calling nonEmptyBuildableOf[C[T],T](g)
.
Generates a non-empty list of random length.
Generates a non-empty list of random length. The maximum length depends
on the size parameter. This method is equal to calling
nonEmptyContainerOf[List,T](g)
.
Generates a non-empty map of random length.
Generates a non-empty map of random length. The maximum length depends
on the size parameter. This method is equal to calling
nonEmptyContainerOf[Map,(T,U)](g)
.
Generates a numerical character
Generates a string of digits
Picks a random generator from a list
Picks a random value from a list
Picks a random value from a list.
Picks a random value from a list.
Remove this overloaded method in the next major release. See #438.
Picks a random value from a list.
Makes a generator result optional.
Makes a generator result optional. Either Some(T)
or None
will be provided.
Creates a generator that can access its generation parameters
A generator that randomly picks a given number of elements from a list
A generator that randomly picks a given number of elements from a list
The elements are not guaranteed to be permuted in random order.
A generator that randomly picks a given number of elements from a list
A generator that randomly picks a given number of elements from a list
The elements are not guaranteed to be permuted in random order.
Generates Int values according to the given Poisson distribution, specified by its rate parameters.
Generates Int values according to the given Poisson distribution, specified by its rate parameters.
The mean equals the rate; the standard deviation is sqrt(rate).
In principle any positive value is a valid rate parameter. However, our method of generating values cannot handle large rates, so we require rate <= 745.
Generates positive numbers of uniform distribution, with an upper bound of the generation size parameter.
Generates a Boolean which has the given chance to be true.
Generates a Boolean which has the given chance to be true.
A fixed point generator.
A fixed point generator. This is useful for making recusive structures e.g.
Gen.recursive[List[Int]] { recurse => Gen.choose(0, 10).flatMap { idx => if (idx < 5) recurse.map(idx :: _) else Gen.const(idx :: Nil) } }
Creates a resized version of a generator
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.
Sequences generators.
Sequences generators. If any of the given generators fails, the resulting generator will also fail.
A generator that returns the current generation size
Creates a generator that can access its generation size
A generator that returns Some(T)
A generator that picks a random number of elements from a list
A generator that picks a random number of elements from a list
Monadic recursion on Gen This is a stack-safe loop that is the same as:
Monadic recursion on Gen This is a stack-safe loop that is the same as:
fn(a).flatMap { case Left(a) => tailRec(a)(fn) case Right(b) => Gen.const(b) }
which is useful for doing monadic loops without blowing up the stack
Generates a version 4 (random) UUID.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
Combines the given generators into one generator that produces a tuple of their generated values.
(Since version ) see corresponding Javadoc for more information.