object Gen extends Serializable
- Alphabetic
- By Inheritance
- Gen
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
Freq[A] = (Int, Gen[A])
Int = Probability of being chosen.
Int = Probability of being chosen. ≥ 0
- final class GenCharExt extends AnyVal
- final case class Now(millisSinceEpoch: Long) extends AnyVal with Product with Serializable
- type Run[+A] = (GenCtx) ⇒ A
- final case class ToNonEmptySeq[S, A](toSeq: (S) ⇒ Seq[A]) extends AnyVal with Product with Serializable
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
implicit
def
_GenCharExt(g: Gen[Char]): GenCharExt
- Annotations
- @inline()
- val alpha: Gen[Char]
- val alphaNumeric: Gen[Char]
- def apply2[A, B, Z](z: (A, B) ⇒ Z)(A: Gen[A], B: Gen[B]): Gen[Z]
- def apply3[A, B, C, Z](z: (A, B, C) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C]): Gen[Z]
- def apply4[A, B, C, D, Z](z: (A, B, C, D) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D]): Gen[Z]
- def apply5[A, B, C, D, E, Z](z: (A, B, C, D, E) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E]): Gen[Z]
- def apply6[A, B, C, D, E, F, Z](z: (A, B, C, D, E, F) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F]): Gen[Z]
- def apply7[A, B, C, D, E, F, G, Z](z: (A, B, C, D, E, F, G) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G]): Gen[Z]
- def apply8[A, B, C, D, E, F, G, H, Z](z: (A, B, C, D, E, F, G, H) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G], H: Gen[H]): Gen[Z]
- def apply9[A, B, C, D, E, F, G, H, I, Z](z: (A, B, C, D, E, F, G, H, I) ⇒ Z)(A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G], H: Gen[H], I: Gen[I]): Gen[Z]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val ascii: Gen[Char]
- def batches[A](as: Vector[A], partitionSize: Inclusive, keepRemainder: Boolean = true): Gen[Vector[Vector[A]]]
- val boolean: Gen[Boolean]
- def byName[A](ga: ⇒ Gen[A]): Gen[A]
- def byNeed[A](ga: ⇒ Gen[A]): Gen[A]
- def byte: Gen[Byte]
-
def
char: Gen[Char]
An alias for unicode, as unicode is the default.
An alias for unicode, as unicode is the default.
- Annotations
- @inline()
- def choose[A](a: A, as: A*): Gen[A]
-
def
chooseArray_![A](as: Array[A]): Gen[A]
Randomly selects one of the given elements.
Randomly selects one of the given elements.
- as
Possible elements. MUST NOT BE EMPTY.
- def chooseChar(nonEmptinessProof: Char, s: String, rs: NumericRange[Char]*): Gen[Char]
- def chooseChar(nonEmptinessProof: Char, rs: NumericRange[Char]*): Gen[Char]
- def chooseChar_!(rs: NumericRange[Char]*): Gen[Char]
- def chooseChar_!(s: String, rs: NumericRange[Char]*): Gen[Char]
-
def
chooseDouble(l: Double, h: Double): Gen[Double]
Args are inclusive.
Args are inclusive. [l,h]
-
def
chooseFloat(l: Float, h: Float): Gen[Float]
Args are inclusive.
Args are inclusive. [l,h]
- def chooseGen[A](g1: Gen[A], gn: Gen[A]*): Gen[A]
- def chooseGenNE[S, G, A](s: S)(implicit ne: ToNonEmptySeq[S, G], g: <:<[G, Gen[A]]): Gen[A]
- def chooseGen_![A](gens: scala.collection.compat.IterableOnce[Gen[A]]): Gen[A]
-
def
chooseIndexed_![A](as: IndexedSeq[A]): Gen[A]
Randomly selects one of the given elements.
Randomly selects one of the given elements.
- as
Possible elements. MUST NOT BE EMPTY.
-
def
chooseInt(l: Int, h: Int): Gen[Int]
Args are inclusive.
Args are inclusive. [l,h]
-
def
chooseInt(bound: Int): Gen[Int]
Generate an int ∈ [0,bound).
Generate an int ∈ [0,bound).
- bound
Upper-bound (exclusive). > 0
-
def
chooseLong(l: Long, h: Long): Gen[Long]
Args are inclusive.
Args are inclusive. [l,h]
-
def
chooseLong(bound: Long): Gen[Long]
Generate a long ∈ [0,bound).
Generate a long ∈ [0,bound).
- bound
Upper-bound (exclusive). > 0
- def chooseNE[S, A](s: S)(implicit ne: ToNonEmptySeq[S, A]): Gen[A]
-
val
chooseSize: Gen[Int]
Returns a number in [0,GenSize)
-
val
chooseSizeMin1: Gen[Int]
Returns a number in [1,GenSize)
-
def
choose_![A](as: scala.collection.compat.IterableOnce[A]): Gen[A]
Randomly selects one of the given elements.
Randomly selects one of the given elements.
- as
Possible elements. MUST NOT BE EMPTY.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- def dateTime(implicit genNow: Gen[Now]): DateTimeBuilder
- def distribute[F[_], B](a: Gen[F[B]])(implicit D: Distributive[F]): F[Gen[B]]
- def distributeK[F[_], A, B](a: Gen[Kleisli[F, A, B]])(implicit D: Distributive[F]): Kleisli[F, A, Gen[B]]
- def distributeR[A, B](a: Gen[(A) ⇒ B]): (A) ⇒ Gen[B]
- def distributeRK[A, B](a: Gen[(A) ⇒ B]): Kleisli[Gen, A, B]
- val double: Gen[Double]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fairlyDistributed[A](as: Iterable[A]): Gen[Iterator[A]]
Ensures that an element is never chosen more than once per n elements.
Ensures that an element is never chosen more than once per n elements.
fairlyDistributedSeq(1, 2, 3)(6) may return [1,3,2,2,1,3] or [3,2,1,3,2,1] but never [1,1,1,1,2,3].
-
def
fairlyDistributedSeq[A](as: Iterable[A])(implicit ss: SizeSpec): Gen[Vector[A]]
Ensures that an element is never chosen more than once per n elements.
Ensures that an element is never chosen more than once per n elements.
fairlyDistributedSeq(1, 2, 3)(6) may return [1,3,2,2,1,3] or [3,2,1,3,2,1] but never [1,1,1,1,2,3].
- def float: Gen[Float]
- def frequency[A](x: Freq[A], xs: Freq[A]*): Gen[A]
- def frequencyL_![A](xs: List[Freq[A]]): Gen[A]
- def frequencyNE[S, F, A](s: S)(implicit ne: ToNonEmptySeq[S, F], f: <:<[Seq[F], Seq[Freq[A]]]): Gen[A]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val int: Gen[Int]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lazily[A](ga: ⇒ Gen[A]): Gen[A]
- Annotations
- @inline()
-
def
lift2[A, B, Z](A: Gen[A], B: Gen[B])(z: (A, B) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift3[A, B, C, Z](A: Gen[A], B: Gen[B], C: Gen[C])(z: (A, B, C) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift4[A, B, C, D, Z](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D])(z: (A, B, C, D) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift5[A, B, C, D, E, Z](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E])(z: (A, B, C, D, E) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift6[A, B, C, D, E, F, Z](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F])(z: (A, B, C, D, E, F) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift7[A, B, C, D, E, F, G, Z](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G])(z: (A, B, C, D, E, F, G) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift8[A, B, C, D, E, F, G, H, Z](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G], H: Gen[H])(z: (A, B, C, D, E, F, G, H) ⇒ Z): Gen[Z]
- Annotations
- @inline()
-
def
lift9[A, B, C, D, E, F, G, H, I, Z](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G], H: Gen[H], I: Gen[I])(z: (A, B, C, D, E, F, G, H, I) ⇒ Z): Gen[Z]
- Annotations
- @inline()
- val long: Gen[Long]
- val lower: Gen[Char]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val negativeDouble: Gen[Double]
- def negativeFloat: Gen[Float]
- val negativeInt: Gen[Int]
- val negativeLong: Gen[Long]
-
def
newOrOld[A](newGen: ⇒ Gen[A], old: ⇒ scala.collection.compat.IterableOnce[A]): Gen[A]
Randomly either generates a new value, or chooses one from a known set.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val numeric: Gen[Char]
-
def
orderedSeq[A](orderedElems: Iterable[A], maxDups: Int, dropElems: Boolean = true, emptyResult: Boolean = true): Gen[Vector[A]]
Generates a sequence of elements in a fixed order.
Generates a sequence of elements in a fixed order.
Example: [a,b,c] can generate [a,b,c], [a,b,b,b,c,c], etc. but never [b,a,c].
- orderedElems
Legal elements in a relevant order.
- maxDups
The maximum number of consecutive, duplicate elements (can be 0).
- dropElems
Whether or not the generator can drop elements. (eg. drop b and return [a,c])
- emptyResult
Whether or not the generator can return an empty vector as a result.
- def point[A](a: ⇒ A): Gen[A]
- val positiveDouble: Gen[Double]
- def positiveFloat: Gen[Float]
- val positiveInt: Gen[Int]
- val positiveLong: Gen[Long]
- def pure[A](a: A): Gen[A]
-
lazy val
reseed: Gen[Unit]
Apply a new, non-deterministic seed.
- implicit val scalazInstance: Monad[Gen] with Distributive[Gen] with BindRec[Gen]
-
def
sequence[T[X] <: Iterable[X], A](gs: T[Gen[A]])(implicit cbf: BuildFrom[T[Gen[A]], A, T[A]]): Gen[T[A]]
- Annotations
- @inline()
- def sequenceZ[T[_], A](gs: T[Gen[A]])(implicit T: Traverse[T]): Gen[T[A]]
- def setConstSeed(seed: Long): Gen[Unit]
- def setOptionalConstSeed(o: Option[Long]): Gen[Unit]
- def setOptionalSeed(o: Option[Long]): Gen[Unit]
- def setSeed(seed: Long): Gen[Unit]
- def setSeedBy(f: (SeedCtx) ⇒ Long): Gen[Unit]
- def short: Gen[Short]
-
def
shuffle[A, C[X] <: Iterable[X]](as: C[A])(implicit bf: BuildFrom[C[A], A, C[A]]): Gen[C[A]]
- Annotations
- @inline()
- def string(implicit ss: SizeSpec): Gen[String]
- def string1(implicit ss: SizeSpec): Gen[String]
- def stringOf(cs: Gen[Char])(implicit ss: SizeSpec): Gen[String]
- def stringOf1(cs: Gen[Char])(implicit ss: SizeSpec): Gen[String]
-
def
subset[A, C[X] <: Iterable[X]](as: C[A])(implicit bf: scala.collection.compat.Factory[A, C[A]]): Gen[C[A]]
- Annotations
- @inline()
-
def
subset1[A, C[X] <: IndexedSeq[X]](as: C[A])(implicit bf: scala.collection.compat.Factory[A, C[A]]): Gen[C[A]]
Generates a non-empty subset, unless the underlying seq is empty (in which case this returns an empty seq too).
Generates a non-empty subset, unless the underlying seq is empty (in which case this returns an empty seq too).
- Annotations
- @inline()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def tailrec[A, B](f: (A) ⇒ Gen[Either[A, B]])(a: A): Gen[B]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[T[X] <: Iterable[X], A, B](as: T[A])(f: (A) ⇒ Gen[B])(implicit cbf: BuildFrom[T[A], B, T[B]]): Gen[T[B]]
- def traverseG[T[X] <: Iterable[X], A, B](gs: T[Gen[A]])(f: (A) ⇒ Gen[B])(implicit cbf: BuildFrom[T[Gen[A]], B, T[B]]): Gen[T[B]]
- def traverseZ[T[_], A, B](as: T[A])(f: (A) ⇒ Gen[B])(implicit T: Traverse[T]): Gen[T[B]]
- def traverseZG[T[_], A, B](gs: T[Gen[A]])(f: (A) ⇒ Gen[B])(implicit T: Traverse[T]): Gen[T[B]]
- def tryChoose[A](as: scala.collection.compat.IterableOnce[A]): Gen[Option[A]]
- def tryGenChoose[A](as: scala.collection.compat.IterableOnce[A]): Option[Gen[A]]
- def tryGenChooseLazily[A](as: scala.collection.compat.IterableOnce[A]): Option[Gen[A]]
- def tuple2[A, B](A: Gen[A], B: Gen[B]): Gen[(A, B)]
- def tuple3[A, B, C](A: Gen[A], B: Gen[B], C: Gen[C]): Gen[(A, B, C)]
- def tuple4[A, B, C, D](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D]): Gen[(A, B, C, D)]
- def tuple5[A, B, C, D, E](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E]): Gen[(A, B, C, D, E)]
- def tuple6[A, B, C, D, E, F](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F]): Gen[(A, B, C, D, E, F)]
- def tuple7[A, B, C, D, E, F, G](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G]): Gen[(A, B, C, D, E, F, G)]
- def tuple8[A, B, C, D, E, F, G, H](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G], H: Gen[H]): Gen[(A, B, C, D, E, F, G, H)]
- def tuple9[A, B, C, D, E, F, G, H, I](A: Gen[A], B: Gen[B], C: Gen[C], D: Gen[D], E: Gen[E], F: Gen[F], G: Gen[G], H: Gen[H], I: Gen[I]): Gen[(A, B, C, D, E, F, G, H, I)]
- val unicode: Gen[Char]
- def unit: Gen[Unit]
- val upper: Gen[Char]
- def uuid: Gen[UUID]
-
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()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
lazy val
zoneId: Gen[ZoneId]
Caution: non-deterministic
- object Now extends Serializable
- object ToNonEmptySeq extends Serializable
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.