- Companion:
- class
Type members
Classlikes
Provides implicit org.scalacheck.Gen.Choose instances
Provides implicit org.scalacheck.Gen.Choose instances
- Companion:
- class
Generator parameters, used by org.scalacheck.Gen.apply
Generator parameters, used by org.scalacheck.Gen.apply
- Companion:
- object
Provides methods for creating org.scalacheck.Gen.Parameters values
Provides methods for creating org.scalacheck.Gen.Parameters values
- Companion:
- class
Value members
Concrete methods
A generator that picks at least one element from a list
A generator that picks at least one element from a list
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. 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. 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. The elements in the
container will be generated by the given generator. The generated container
will continuously frow in size until the fillCondition
returns true.
Unlike buildableOfCond
, this version of the method lets you specify another
collection Gen which helps in speeding up the process of growing the collection.
If the given generator fails generating a value, the
complete container generator will also fail.
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 generated container
will continuously frow in size until the fillCondition
returns true.
Unlike buildableOfCond
, this version of the method lets you specify another
collection Gen which helps in speeding up the process of growing the collection.
If the given generator fails generating a value, the
complete container generator will also fail.
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 generated container
will continuously grow in size until the fillCondition
returns true.
If the given generator fails generating a value, the
complete container generator will also fail.
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 generated container
will continuously grow in size until the fillCondition
returns true.
If the given generator fails generating a value, the
complete container generator will also fail.
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.
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. If the range is invalid, an IllegalBoundsError exception will be thrown.
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. The special numbers must lie within the given range, otherwise they won't be included.
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 convenience method for calling buildableOf[C[T],T](g)
.
A convenience method for calling buildableOf[C[T],T](g)
.
A convenience method for calling buildableOfN[C[T],T](n,g)
.
A convenience method for calling buildableOfN[C[T],T](n,g)
.
Wraps a generator for later evaluation. The given parameter is evaluated each time the wrapper generator is evaluated.
Wraps a generator for later evaluation. The given parameter is evaluated each time the wrapper generator is evaluated.
Generates a Left
of T
or a Right
of U
with equal probability.
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, ∞).
Chooses one of the given generators with a weighted random distribution
Chooses one of the given generators with a weighted random distribution
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 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. The maximum length depends on the
size parameter. This method is equal to calling
containerOf[List,T](g)
.
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 that continuously grows in size until
finishCondition
returns true.
Generates a list that continuously grows in size until
finishCondition
returns true.
Generates a list that continuously grows in size until
finishCondition
returns true. Unlike listOfCond
it
accepts a list generator argument which lets you generate
larger lists quicker
Generates a list that continuously grows in size until
finishCondition
returns true. Unlike listOfCond
it
accepts a list generator argument which lets you generate
larger lists quicker
Generates a list with at most the given number of elements. This method
is equal to calling containerOfN[List,T](n,g)
.
Generates a list with at most the given number of elements. This method
is equal to calling containerOfN[List,T](n,g)
.
Wraps a generator lazily. The given parameter is only evaluated once, and not until the wrapper generator is evaluated.
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. The maximum length depends on the
size parameter. This method is equal to calling
containerOfMap,(T,U)
.
Generates a map of random length. The maximum length depends on the
size parameter. This method is equal to calling
containerOfMap,(T,U)
.
Generates a map that continuously grows in size until
finishCondition
returns true.
Generates a map that continuously grows in size until
finishCondition
returns true.
Generates a map that continuously grows in size until
finishCondition
returns true. Unlike mapOfCond
it
accepts a map generator argument which lets you generate
larger maps quicker
Generates a map that continuously grows in size until
finishCondition
returns true. Unlike mapOfCond
it
accepts a map generator argument which lets you generate
larger maps quicker
Generates a map with at most the given number of elements. This method
is equal to calling containerOfNMap,(T,U)
.
Generates a map with at most the given number of elements. This method
is equal to calling containerOfNMap,(T,U)
.
Generates negative numbers of uniform distribution, with an lower bound of the negated generation size parameter.
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. 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 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)
.
A convenience method for calling nonEmptyBuildableOf[C[T],T](g)
.
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 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. The maximum length depends
on the size parameter. This method is equal to calling
nonEmptyContainerOfMap,(T,U)
.
Generates a non-empty map of random length. The maximum length depends
on the size parameter. This method is equal to calling
nonEmptyContainerOfMap,(T,U)
.
Picks a random value from a list.
Picks a random value from a list.
- Todo:
Remove this overloaded method in the next major release. See #438.
Makes a generator result optional. Either Some(T)
or None
will be provided.
Makes a generator result optional. Either Some(T)
or None
will be provided.
Creates a generator that can access its generation parameters
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 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.
- prob(1.0) is always true
- prob(0.5) is true 50% of the time
- prob(0.1) is true 10% of the time
- prob(0.0) is never true
A fixed point generator. This is useful for making recursive structures e.g.
A fixed point generator. This is useful for making recursive 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) } }
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. If any of the given generators fails, the resulting generator will also fail.
Sequences generators. If any of the given generators fails, the resulting generator will also fail.
Creates a generator that can access its generation size
Creates a generator that can access its generation size
A generator that picks a random number of elements from a list
A generator that picks a random number of elements from a list
A generator that picks a random number of elements from a list
A generator that picks a random number of elements from a list
Inherited methods
Gen creator for Function11
Gen creator for Function11
- Inherited from:
- GenArities
Gen creator for Function12
Gen creator for Function12
- Inherited from:
- GenArities
Gen creator for Function13
Gen creator for Function13
- Inherited from:
- GenArities
Gen creator for Function14
Gen creator for Function14
- Inherited from:
- GenArities
Gen creator for Function15
Gen creator for Function15
- Inherited from:
- GenArities
Gen creator for Function16
Gen creator for Function16
- Inherited from:
- GenArities
Gen creator for Function17
Gen creator for Function17
- Inherited from:
- GenArities
Gen creator for Function18
Gen creator for Function18
- Inherited from:
- GenArities
Gen creator for Function19
Gen creator for Function19
- Inherited from:
- GenArities
Gen creator for Function20
Gen creator for Function20
- Inherited from:
- GenArities
Gen creator for Function21
Gen creator for Function21
- Inherited from:
- GenArities
Gen creator for Function22
Gen creator for Function22
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
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.
- Inherited from:
- GenArities
Concrete fields
Generates a ASCII character, with extra weighting for printable characters
Generates a ASCII character, with extra weighting for printable characters
Generates a string of ASCII characters, with extra weighting for printable characters
Generates a string of ASCII characters, with extra weighting for printable characters
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 character that can represent a valid hexadecimal digit. This includes both upper and lower case values.
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. This includes both upper and lower case values.
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 a string that starts with a lower-case alpha character, and only contains alphanumerical characters
Generate a uniformly-distributed Long.
Generate a uniformly-distributed Long.
This method has an equally likely method of generating every possible Long value.