org.scalatest.prop

Generator

object Generator

Companion to the Generator trait, which contains many of the standard implicit Generators.

For the most part, you should not need to use the values and functions in here directly; the useful values in here are generally aliased in CommonGenerators (albeit with different names), which in turn is mixed into GeneratorDrivenPropertyChecks and TableDrivenPropertyChecks.

Note that this provides Generators for the common Scalactic types, as well as the common standard library ones.

Source
Generator.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Generator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. implicit val booleanGenerator: Generator[Boolean]

    A Generator that produces Boolean values.

  8. implicit val byteGenerator: Generator[Byte]

    A Generator that produces Byte values.

  9. implicit val charGenerator: Generator[Char]

    A Generator that produces Char values.

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. implicit val doubleGenerator: Generator[Double]

    A Generator that produces Double values.

  12. implicit def eitherGenerator[L, R](implicit genOfL: Generator[L], genOfR: Generator[R]): Generator[Either[L, R]]

    Given Generators for two types, L and R, this provides one for Either[L, R].

    Given Generators for two types, L and R, this provides one for Either[L, R].

    L

    the "left" type for an Either

    R

    the "right" type for an Either

    genOfL

    a Generator that produces type L

    genOfR

    a Generator that produces type R

    returns

    a Generator that produces Either[L, R]

  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. implicit val finiteDoubleGenerator: Generator[FiniteDouble]

    A Generator that produces Doubles, excluding infinity.

  17. implicit val finiteFloatGenerator: Generator[FiniteFloat]

    A Generator that produces Floats, excluding infinity.

  18. implicit val floatGenerator: Generator[Float]

    A Generator that produces Float values.

  19. implicit def function0Generator[T](implicit genOfT: Generator[T]): Generator[() ⇒ T]

    Given a Generator that produces values of type T, this returns one that produces functions that return a T.

    Given a Generator that produces values of type T, this returns one that produces functions that return a T.

    The functions produced here are nullary -- they take no parameters, they just spew out values of type T.

    T

    the type to produce

    genOfT

    a Generator that produces values of T

    returns

    a Generator that produces functions that return values of type T

  20. implicit def function10Generator[A, B, C, D, E, F, G, H, I, J, K](implicit genOfK: Generator[K], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K]): Generator[(A, B, C, D, E, F, G, H, I, J) ⇒ K]

    See function1Generator.

  21. implicit def function11Generator[A, B, C, D, E, F, G, H, I, J, K, L](implicit genOfL: Generator[L], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L]): Generator[(A, B, C, D, E, F, G, H, I, J, K) ⇒ L]

    See function1Generator.

  22. implicit def function12Generator[A, B, C, D, E, F, G, H, I, J, K, L, M](implicit genOfM: Generator[M], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L) ⇒ M]

    See function1Generator.

  23. implicit def function13Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N](implicit genOfN: Generator[N], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M) ⇒ N]

    See function1Generator.

  24. implicit def function14Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O](implicit genOfO: Generator[O], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N) ⇒ O]

    See function1Generator.

  25. implicit def function15Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P](implicit genOfP: Generator[P], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) ⇒ P]

    See function1Generator.

  26. implicit def function16Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q](implicit genOfQ: Generator[Q], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) ⇒ Q]

    See function1Generator.

  27. implicit def function17Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R](implicit genOfR: Generator[R], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q], typeInfoR: TypeInfo[R]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) ⇒ R]

    See function1Generator.

  28. implicit def function18Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S](implicit genOfS: Generator[S], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q], typeInfoR: TypeInfo[R], typeInfoS: TypeInfo[S]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) ⇒ S]

    See function1Generator.

  29. implicit def function19Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T](implicit genOfT: Generator[T], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q], typeInfoR: TypeInfo[R], typeInfoS: TypeInfo[S], typeInfoT: TypeInfo[T]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) ⇒ T]

    See function1Generator.

  30. implicit def function1Generator[A, B](implicit genOfB: Generator[B], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B]): Generator[(A) ⇒ B]

    Create a Generator of functions from type A to type B.

    Create a Generator of functions from type A to type B.

    Note that the generated functions are, necessarily, pretty random. In practice, the function you get from a function1Generator (and its variations, up through function22Generator) takes the hashes of its input values, combines those with a randomly-chosen number, and combines them in order to choose the generated value B.

    That said, each of the generated functions is deterministic: given the same input parameters and the same randomly-chosen number, you will always get the same B result. And the toString function on the generated function will show the formula you need to use in order to recreate that, which will look something like:

    (a: Int, b: String, c: Float) => org.scalatest.prop.valueOf[String](a, b, c)(131)

    The number and type of the a, b, c, etc, parameters, as well as the type parameter of valueOf, will on the function type you are generating, but they will always follow this pattern. valueOf is the underlying function that takes these parameters and the randomly-chosen number, and returns a value of the specified type.

    So if a property evaluation fails, the display of the generated function will tell you how to call valueOf to recreate the failure.

    The typeInfo parameters are automatically created via macros; you should generally not try to pass them manually.

    A

    the input type for the generated functions

    B

    the result type for the generated functions

    genOfB

    a Generator for the desired result type B

    typeInfoA

    automatically-created type information for type A

    typeInfoB

    automatically-created type information for type B

    returns

    a Generator that produces functions that take values of A and returns values of B

  31. implicit val function1IntToIntGenerator: Generator[(Int) ⇒ Int]

    Generate functions that take an Int and return a modified Int.

    Generate functions that take an Int and return a modified Int.

    This Generator is useful for testing edge cases of some higher-order functions. Besides obvious functions (returning the same Int, returning that Int plus 1), it tests overflow situations such as adding Int.MaxValue, negation, and other such cases.

  32. implicit def function20Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U](implicit genOfU: Generator[U], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q], typeInfoR: TypeInfo[R], typeInfoS: TypeInfo[S], typeInfoT: TypeInfo[T], typeInfoU: TypeInfo[U]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) ⇒ U]

    See function1Generator.

  33. implicit def function21Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V](implicit genOfV: Generator[V], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q], typeInfoR: TypeInfo[R], typeInfoS: TypeInfo[S], typeInfoT: TypeInfo[T], typeInfoU: TypeInfo[U], typeInfoV: TypeInfo[V]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) ⇒ V]

    See function1Generator.

  34. implicit def function22Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W](implicit genOfW: Generator[W], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J], typeInfoK: TypeInfo[K], typeInfoL: TypeInfo[L], typeInfoM: TypeInfo[M], typeInfoN: TypeInfo[N], typeInfoO: TypeInfo[O], typeInfoP: TypeInfo[P], typeInfoQ: TypeInfo[Q], typeInfoR: TypeInfo[R], typeInfoS: TypeInfo[S], typeInfoT: TypeInfo[T], typeInfoU: TypeInfo[U], typeInfoV: TypeInfo[V], typeInfoW: TypeInfo[W]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) ⇒ W]

    See function1Generator.

  35. implicit def function2Generator[A, B, C](implicit genOfC: Generator[C], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C]): Generator[(A, B) ⇒ C]

    See function1Generator.

  36. implicit def function3Generator[A, B, C, D](implicit genOfD: Generator[D], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D]): Generator[(A, B, C) ⇒ D]

    See function1Generator.

  37. implicit def function4Generator[A, B, C, D, E](implicit genOfE: Generator[E], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E]): Generator[(A, B, C, D) ⇒ E]

    See function1Generator.

  38. implicit def function5Generator[A, B, C, D, E, F](implicit genOfF: Generator[F], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F]): Generator[(A, B, C, D, E) ⇒ F]

    See function1Generator.

  39. implicit def function6Generator[A, B, C, D, E, F, G](implicit genOfG: Generator[G], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G]): Generator[(A, B, C, D, E, F) ⇒ G]

    See function1Generator.

  40. implicit def function7Generator[A, B, C, D, E, F, G, H](implicit genOfH: Generator[H], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H]): Generator[(A, B, C, D, E, F, G) ⇒ H]

    See function1Generator.

  41. implicit def function8Generator[A, B, C, D, E, F, G, H, I](implicit genOfI: Generator[I], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I]): Generator[(A, B, C, D, E, F, G, H) ⇒ I]

    See function1Generator.

  42. implicit def function9Generator[A, B, C, D, E, F, G, H, I, J](implicit genOfJ: Generator[J], typeInfoA: TypeInfo[A], typeInfoB: TypeInfo[B], typeInfoC: TypeInfo[C], typeInfoD: TypeInfo[D], typeInfoE: TypeInfo[E], typeInfoF: TypeInfo[F], typeInfoG: TypeInfo[G], typeInfoH: TypeInfo[H], typeInfoI: TypeInfo[I], typeInfoJ: TypeInfo[J]): Generator[(A, B, C, D, E, F, G, H, I) ⇒ J]

    See function1Generator.

  43. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  44. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  45. implicit val intGenerator: Generator[Int]

    A Generator that produces Int values.

  46. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  47. implicit def listGenerator[T](implicit genOfT: Generator[T]): Generator[List[T]] with HavingLength[List[T]]

    Given an existing Generator[T], this creates a Generator[List[T]].

    Given an existing Generator[T], this creates a Generator[List[T]].

    T

    the type that we are producing a List of

    genOfT

    a Generator that produces values of type T

    returns

    a List of values of type T

  48. implicit val longGenerator: Generator[Long]

    A Generator that produces Long values.

  49. implicit def mapGenerator[K, V](implicit genOfTuple2KV: Generator[(K, V)]): Generator[Map[K, V]] with HavingSize[Map[K, V]]

    Given a Generator that produces Tuples of key/value pairs, this gives you one that produces Maps with those pairs.

    Given a Generator that produces Tuples of key/value pairs, this gives you one that produces Maps with those pairs.

    If you are simply looking for random pairing of the key and value types, this is pretty easy to use: if both the key and value types have Generators, then the Tuple and Map ones will be automatically and implicitly created when you need them.

    The resulting Generator also has the HavingSize trait, so you can use it to generate Maps with specific sizes.

    K

    the type of the keys for the Map

    V

    the type of the values for the Map

    genOfTuple2KV

    a Generator that produces Tuples of K and V

    returns

    a Generator of Maps from K to V

  50. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  51. implicit val negDoubleGenerator: Generator[NegDouble]

    A Generator that produces negative Doubles, excluding zero but including infinity.

  52. implicit val negFiniteDoubleGenerator: Generator[NegFiniteDouble]

    A Generator that produces negative Doubles, excluding zero and infinity.

  53. implicit val negFiniteFloatGenerator: Generator[NegFiniteFloat]

    A Generator that produces negative Floats, excluding zero and infinity.

  54. implicit val negFloatGenerator: Generator[NegFloat]

    A Generator that produces negative Floats, excluding zero but including infinity.

  55. implicit val negIntGenerator: Generator[NegInt]

    A Generator that produces negative Ints, excluding zero.

  56. implicit val negLongGenerator: Generator[NegLong]

    A Generator that produces negative Longs, excluding zero.

  57. implicit val negZDoubleGenerator: Generator[NegZDouble]

    A Generator that produces negative Doubles, including zero and infinity.

  58. implicit val negZFiniteDoubleGenerator: Generator[NegZFiniteDouble]

    A Generator that produces negative Doubles, including zero but excluding infinity.

  59. implicit val negZFiniteFloatGenerator: Generator[NegZFiniteFloat]

    A Generator that produces negative Floats, including zero but excluding infinity.

  60. implicit val negZFloatGenerator: Generator[NegZFloat]

    A Generator that produces negative Floats, including zero and infinity.

  61. implicit val negZIntGenerator: Generator[NegZInt]

    A Generator that produces negative Ints, including zero.

  62. implicit val negZLongGenerator: Generator[NegZLong]

    A Generator that produces negative Longs, including zero.

  63. implicit val nonZeroDoubleGenerator: Generator[NonZeroDouble]

    A Generator that produces Doubles, excluding zero but including infinity.

  64. implicit val nonZeroFiniteDoubleGenerator: Generator[NonZeroFiniteDouble]

    A Generator that produces Doubles, excluding zero and infinity.

  65. implicit val nonZeroFiniteFloatGenerator: Generator[NonZeroFiniteFloat]

    A Generator that produces Floats, excluding zero and infinity.

  66. implicit val nonZeroFloatGenerator: Generator[NonZeroFloat]

    A Generator that produces Floats, excluding zero but including infinity.

  67. implicit val nonZeroIntGenerator: Generator[NonZeroInt]

    A Generator that produces integers, excluding zero.

  68. implicit val nonZeroLongGenerator: Generator[NonZeroLong]

    A Generator that produces Longs, excluding zero.

  69. final def notify(): Unit

    Definition Classes
    AnyRef
  70. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  71. implicit val numericCharGenerator: Generator[NumericChar]

    A Generator that produces Chars, but only the ones that represent digits.

  72. implicit def optionGenerator[T](implicit genOfT: Generator[T]): Generator[Option[T]]

    Given a Generator for type T, this provides one for Option[T].

    Given a Generator for type T, this provides one for Option[T].

    T

    the type to generate

    genOfT

    a Generator that produces type T

    returns

    a Generator that produces Option[T]

  73. implicit def orGenerator[G, B](implicit genOfG: Generator[G], genOfB: Generator[B]): Generator[Or[G, B]]

    Given Generators for two types, G and B, this provides one for G Or B.

    Given Generators for two types, G and B, this provides one for G Or B.

    G

    the "good" type for an Or

    B

    the "bad" type for an Or

    genOfG

    a Generator that produces type G

    genOfB

    a Generator that produces type B

    returns

    a Generator that produces G Or B

  74. implicit val posDoubleGenerator: Generator[PosDouble]

    A Generator that produces positive Doubles, excluding zero but including infinity.

  75. implicit val posFiniteDoubleGenerator: Generator[PosFiniteDouble]

    A Generator that produces positive Doubles, excluding zero and infinity.

  76. implicit val posFiniteFloatGenerator: Generator[PosFiniteFloat]

    A Generator that produces positive Floats, excluding zero and infinity.

  77. implicit val posFloatGenerator: Generator[PosFloat]

    A Generator that produces positive Floats, excluding zero.

  78. implicit val posIntGenerator: Generator[PosInt]

    A Generator that produces positive integers, excluding zero.

  79. implicit val posLongGenerator: Generator[PosLong]

    A Generator that produces positive Longs, excluding zero.

  80. implicit val posZDoubleGenerator: Generator[PosZDouble]

    A Generator that produces positive Doubles, including zero and infinity.

  81. implicit val posZFiniteDoubleGenerator: Generator[PosZFiniteDouble]

    A Generator that produces positive Doubles, including zero but excluding infinity.

  82. implicit val posZFiniteFloatGenerator: Generator[PosZFiniteFloat]

    A Generator that produces positive Floats, including zero but excluding infinity.

  83. implicit val posZFloatGenerator: Generator[PosZFloat]

    A Generator that produces positive Floats, including zero and infinity.

  84. implicit val posZIntGenerator: Generator[PosZInt]

    A Generator that produces positive integers, including zero.

  85. implicit val posZLongGenerator: Generator[PosZLong]

    A Generator that produces positive Longs, including zero.

  86. implicit def setGenerator[T](implicit genOfT: Generator[T]): Generator[Set[T]] with HavingSize[Set[T]]

    Given a Generator that produces values of type T, this creates one for a Set of T.

    Given a Generator that produces values of type T, this creates one for a Set of T.

    Note that the Set type is considered to have a "size", so you can use the configuration parameters Configuration.minSize and Configuration.sizeRange to constrain the sizes of the resulting Sets when you use this Generator.

    The resulting Generator also has the HavingSize trait, so you can use it to generate Sets with specific sizes.

    T

    the type to produce

    genOfT

    a Generator that produces values of type T

    returns

    a Generator that produces Set[T].

  87. implicit val shortGenerator: Generator[Short]

    A Generator that produces Short values.

  88. implicit def sortedMapGenerator[K, V](implicit genOfTuple2KV: Generator[(K, V)], ordering: Ordering[K]): Generator[SortedMap[K, V]] with HavingSize[SortedMap[K, V]]

    Given a Generator that produces Tuples of key/value pairs, this gives you one that produces SortedMaps with those pairs.

    Given a Generator that produces Tuples of key/value pairs, this gives you one that produces SortedMaps with those pairs.

    If you are simply looking for random pairing of the key and value types, this is pretty easy to use: if both the key and value types have Generators, then the Tuple and SortedMap ones will be automatically and implicitly created when you need them.

    The resulting Generator also has the HavingSize trait, so you can use it to generate SortedMaps with specific sizes.

    K

    the type of the keys for the SortedMap

    V

    the type of the values for the SortedMap

    genOfTuple2KV

    a Generator that produces Tuples of K and V

    returns

    a Generator of SortedMaps from K to V

  89. implicit def sortedSetGenerator[T](implicit genOfT: Generator[T], ordering: Ordering[T]): Generator[SortedSet[T]] with HavingSize[SortedSet[T]]

    Given a Generator that produces values of type T, this creates one for a SortedSet of T.

    Given a Generator that produces values of type T, this creates one for a SortedSet of T.

    Note that the SortedSet type is considered to have a "size", so you can use the configuration parameters Configuration.minSize and Configuration.sizeRange to constrain the sizes of the resulting SortedSets when you use this Generator.

    The resulting Generator also has the HavingSize trait, so you can use it to generate SortedSets with specific sizes.

    T

    the type to produce

    genOfT

    a Generator that produces values of type T

    returns

    a Generator that produces SortedSet[T].

  90. implicit val stringGenerator: Generator[String]

    A Generator that produces arbitrary Strings.

    A Generator that produces arbitrary Strings.

    Note that this does not confine itself to ASCII! While failed tests will try to shrink to readable ASCII, this will produce arbitrary Unicode Strings.

  91. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  92. def toString(): String

    Definition Classes
    AnyRef → Any
  93. implicit def tuple10Generator[A, B, C, D, E, F, G, H, I, J](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J]): Generator[(A, B, C, D, E, F, G, H, I, J)]

    See tuple2Generator.

  94. implicit def tuple11Generator[A, B, C, D, E, F, G, H, I, J, K](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K]): Generator[(A, B, C, D, E, F, G, H, I, J, K)]

    See tuple2Generator.

  95. implicit def tuple12Generator[A, B, C, D, E, F, G, H, I, J, K, L](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L)]

    See tuple2Generator.

  96. implicit def tuple13Generator[A, B, C, D, E, F, G, H, I, J, K, L, M](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M)]

    See tuple2Generator.

  97. implicit def tuple14Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N)]

    See tuple2Generator.

  98. implicit def tuple15Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)]

    See tuple2Generator.

  99. implicit def tuple16Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)]

    See tuple2Generator.

  100. implicit def tuple17Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P], genOfQ: Generator[Q]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)]

    See tuple2Generator.

  101. implicit def tuple18Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P], genOfQ: Generator[Q], genOfR: Generator[R]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)]

    See tuple2Generator.

  102. implicit def tuple19Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P], genOfQ: Generator[Q], genOfR: Generator[R], genOfS: Generator[S]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)]

    See tuple2Generator.

  103. implicit def tuple20Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P], genOfQ: Generator[Q], genOfR: Generator[R], genOfS: Generator[S], genOfT: Generator[T]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)]

    See tuple2Generator.

  104. implicit def tuple21Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P], genOfQ: Generator[Q], genOfR: Generator[R], genOfS: Generator[S], genOfT: Generator[T], genOfU: Generator[U]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)]

    See tuple2Generator.

  105. implicit def tuple22Generator[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I], genOfJ: Generator[J], genOfK: Generator[K], genOfL: Generator[L], genOfM: Generator[M], genOfN: Generator[N], genOfO: Generator[O], genOfP: Generator[P], genOfQ: Generator[Q], genOfR: Generator[R], genOfS: Generator[S], genOfT: Generator[T], genOfU: Generator[U], genOfV: Generator[V]): Generator[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)]

    See tuple2Generator.

  106. implicit def tuple2Generator[A, B](implicit genOfA: Generator[A], genOfB: Generator[B]): Generator[(A, B)]

    Given Generators for types A and B, get one that produces Tuples of those types.

    Given Generators for types A and B, get one that produces Tuples of those types.

    tuple2Generator (and its variants, up through tuple22Generator) will create Generators on demand for essentially arbitrary Tuples, so long as you have Generators in implicit scope for all of the component types.

    A

    the first type in the Tuple

    B

    the second type in the Tuple

    genOfA

    a Generator for type A

    genOfB

    a Generator for type B

    returns

    a Generator that produces the desired types, Tupled together.

  107. implicit def tuple3Generator[A, B, C](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C]): Generator[(A, B, C)]

    See tuple2Generator.

  108. implicit def tuple4Generator[A, B, C, D](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D]): Generator[(A, B, C, D)]

    See tuple2Generator.

  109. implicit def tuple5Generator[A, B, C, D, E](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E]): Generator[(A, B, C, D, E)]

    See tuple2Generator.

  110. implicit def tuple6Generator[A, B, C, D, E, F](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F]): Generator[(A, B, C, D, E, F)]

    See tuple2Generator.

  111. implicit def tuple7Generator[A, B, C, D, E, F, G](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G]): Generator[(A, B, C, D, E, F, G)]

    See tuple2Generator.

  112. implicit def tuple8Generator[A, B, C, D, E, F, G, H](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H]): Generator[(A, B, C, D, E, F, G, H)]

    See tuple2Generator.

  113. implicit def tuple9Generator[A, B, C, D, E, F, G, H, I](implicit genOfA: Generator[A], genOfB: Generator[B], genOfC: Generator[C], genOfD: Generator[D], genOfE: Generator[E], genOfF: Generator[F], genOfG: Generator[G], genOfH: Generator[H], genOfI: Generator[I]): Generator[(A, B, C, D, E, F, G, H, I)]

    See tuple2Generator.

  114. implicit def vectorGenerator[T](implicit genOfT: Generator[T]): Generator[Vector[T]] with HavingLength[Vector[T]]

    Given a Generator for type T, this creates one for a Vector of T.

    Given a Generator for type T, this creates one for a Vector of T.

    Note that the Vector type is considered to have a "size", so you can use the configuration parameters Configuration.minSize and Configuration.sizeRange to constrain the sizes of the resulting Vectors when you use this Generator.

    The resulting Generator also has the HavingLength trait, so you can use it to generate Vectors with specific lengths.

    T

    the type to produce

    genOfT

    a Generator that produces values of type T

    returns

    a Generator that produces values of type Vector[T]

  115. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  116. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  117. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  118. implicit def widen[T, U](genOfT: Generator[T])(implicit ev: <:<[T, U]): Generator[U]

    Allow Generators of a type to be used as Generators of a supertype.

    Allow Generators of a type to be used as Generators of a supertype.

    Given:

    • You have a type T
    • T has a supertype U
    • You have a Generator that produces values of T

    This allows you to pass that Generator[T] as a Generator[U].

    We do this instead of making Generator covariant, because then an implicit search for a Generator[U] would always be satisfied if it found just a Generator[T], and would then not generate anything except the subtype. That would be sound, but you wouldn't get a good variety of supertype values. This way, the subtype/supertype conversion is somewhat better-controlled.

    T

    the subtype that we have a Generator for

    U

    the supertype that we want a Generator for

    genOfT

    a Generator that produces values of T

    ev

    implicit evidence that T is a subtype of U

    returns

    a Generator[U] derived from the Generator[T]

Inherited from AnyRef

Inherited from Any

Ungrouped