sealed abstract class Gen[+T] extends Serializable
- Self Type
- Gen[T]
- Alphabetic
- By Inheritance
- Gen
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- case class RetryUntilException(n: Int) extends RuntimeException with Product with Serializable
-
final
class
WithFilter extends AnyRef
A class supporting filtered operations.
Value Members
- def !=[U](g: Gen[U]): Prop
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def !==[U](g: Gen[U]): Prop
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
:|(l: Symbol): Gen[T]
Put a label on the generator to make test reports clearer
-
def
:|(l: String): Gen[T]
Put a label on the generator to make test reports clearer
-
def
==[U](g: Gen[U]): Prop
Returns a new property that holds if and only if both this and the given generator generates the same result, or both generators generate no result.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(p: Parameters, seed: Seed): Option[T]
Evaluate this generator with the given parameters
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def doPureApply(p: Parameters, seed: Seed, retries: Int = 100): R[T]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filter(p: (T) ⇒ Boolean): Gen[T]
Create a new generator that uses this generator to produce a value that fulfills the given condition.
Create a new generator that uses this generator to produce a value that fulfills the given condition. If the condition is not fulfilled, the generator fails (returns None). Also, make sure that the provided test property is side-effect free, e.g. it should not use external vars.
-
def
filterNot(p: (T) ⇒ Boolean): Gen[T]
Create a new generator that uses this generator to produce a value that doesn't fulfill the given condition.
Create a new generator that uses this generator to produce a value that doesn't fulfill the given condition. If the condition is fulfilled, the generator fails (returns None). Also, make sure that the provided test property is side-effect free, e.g. it should not use external vars.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[U](f: (T) ⇒ Gen[U]): Gen[U]
Create a new generator by flat-mapping the result of this generator
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
label(l: String): Gen[T]
Put a label on the generator to make test reports clearer
-
def
map[U](f: (T) ⇒ U): Gen[U]
Create a new generator by mapping the result of this generator
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pureApply(p: Parameters, seed: Seed, retries: Int = 100): T
Evaluate this generator with the given parameters.
Evaluate this generator with the given parameters.
The generator will attempt to generate a valid
T
value. If a valid value is not produced it may retry several times, determined by theretries
parameter (which defaults to 100).If all the retries fail it will throw a
Gen.RetrievalError
exception. -
def
retryUntil(p: (T) ⇒ Boolean): Gen[T]
Create a generator that calls this generator repeatedly until the given condition is fulfilled.
Create a generator that calls this generator repeatedly until the given condition is fulfilled. The generated value is then returned. Make sure that the provided test property is side-effect free (it should not use external vars).
If the generator fails more than 10000 times, a RetryUntilException will be thrown. You can call
retryUntil
with a second parameter to change this number. -
def
retryUntil(p: (T) ⇒ Boolean, maxTries: Int): Gen[T]
Create a generator that calls this generator repeatedly until the given condition is fulfilled.
Create a generator that calls this generator repeatedly until the given condition is fulfilled. The generated value is then returned. Make sure that the provided test property is side-effect free (it should not use external vars).
If the generator fails more than maxTries, a RetryUntilException will be thrown.
- def sample: Option[T]
-
def
suchThat(f: (T) ⇒ Boolean): Gen[T]
Create a new generator that uses this generator to produce a value that fulfills the given condition.
Create a new generator that uses this generator to produce a value that fulfills the given condition. If the condition is not fulfilled, the generator fails (returns None). Also, make sure that the provided test property is side-effect free, e.g. it should not use external vars. This method is identical to [Gen.filter].
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withFilter(p: (T) ⇒ Boolean): WithFilter
Creates a non-strict filtered version of this generator.
-
def
withPerturb(f: (Seed) ⇒ Seed): Gen[T]
Perform some RNG perturbation before generating
-
def
|:(l: Symbol): Gen[T]
Put a label on the generator to make test reports clearer
-
def
|:(l: String): Gen[T]
Put a label on the generator to make test reports clearer