A Gen[R, A] represents a generator of values of type A, which requires an environment R. Generators may be random or deterministic.
Attributes
Members list
Value members
Concrete methods
A symbolic alias for concat.
A symbolic alias for zip.
Maps the values produced by this generator with the specified partial function, discarding any values the partial function is not defined at.
Maps the values produced by this generator with the specified partial function, discarding any values the partial function is not defined at.
Attributes
- Source
- Gen.scala
Concatenates the specified deterministic generator with this determinstic generator, resulting in a deterministic generator that generates the values from this generator and then the values from the specified generator.
Concatenates the specified deterministic generator with this determinstic generator, resulting in a deterministic generator that generates the values from this generator and then the values from the specified generator.
Attributes
- Source
- Gen.scala
Filters the values produced by this generator, discarding any values that do not meet the specified predicate. Using filter can reduce test performance, especially if many values must be discarded. It is recommended to use combinators such as map and flatMap to create generators of the desired values instead.
Filters the values produced by this generator, discarding any values that do not meet the specified predicate. Using filter can reduce test performance, especially if many values must be discarded. It is recommended to use combinators such as map and flatMap to create generators of the desired values instead.
val evens: Gen[Any, Int] = Gen.int.map(_ * 2)
Attributes
- Source
- Gen.scala
Filters the values produced by this generator, discarding any values that meet the specified predicate.
Filters the values produced by this generator, discarding any values that meet the specified predicate.
Attributes
- Source
- Gen.scala
Filters the values produced by this generator, discarding any values that do not meet the specified effectual predicate. Using filterZIO can reduce test performance, especially if many values must be discarded. It is recommended to use combinators such as map and flatMap to create generators of the desired values instead.
Filters the values produced by this generator, discarding any values that do not meet the specified effectual predicate. Using filterZIO can reduce test performance, especially if many values must be discarded. It is recommended to use combinators such as map and flatMap to create generators of the desired values instead.
val evens: Gen[Any, Int] = Gen.int.map(_ * 2)
Attributes
- Source
- Gen.scala
Attributes
- Source
- Gen.scala
Attributes
- Source
- Gen.scala
Maps an effectual function over a generator.
Discards the shrinker for this generator.
Discards the shrinker for this generator and applies a new shrinker by mapping each value to a sample using the specified function. This is useful when the process to shrink a value is simpler than the process used to generate it.
Discards the shrinker for this generator and applies a new shrinker by mapping each value to a sample using the specified function. This is useful when the process to shrink a value is simpler than the process used to generate it.
Attributes
- Source
- Gen.scala
Sets the size parameter for this generator to the specified value.
Runs the generator and collects all of its values in a list.
Repeatedly runs the generator and collects the specified number of values in a list.
Repeatedly runs the generator and collects the specified number of values in a list.
Attributes
- Source
- Gen.scala
Runs the generator returning the first value of the generator.
Attributes
- Source
- Gen.scala
Composes this generator with the specified generator to create a cartesian product of elements.
Composes this generator with the specified generator to create a cartesian product of elements.
Attributes
- Source
- Gen.scala
Composes this generator with the specified generator to create a cartesian product of elements with the specified function.
Composes this generator with the specified generator to create a cartesian product of elements with the specified function.
Attributes
- Source
- Gen.scala