org.scalacheck

Gen

object Gen extends AnyRef

Contains combinators for building generators.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Gen
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Type Members

  1. case class Params (size: Int, rng: Random) extends Product with Serializable

    Record that encapsulates all parameters required for data generation

Value Members

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  6. def alphaChar : Gen[Char]

  7. def alphaLowerChar : Gen[Char]

  8. def alphaNumChar : Gen[Char]

  9. def alphaStr : Gen[String]

  10. def alphaUpperChar : Gen[Char]

  11. def apply [T] (g: (Params) ⇒ Option[T]): Gen[T]

  12. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  13. def choose [T] (min: T, max: T)(implicit c: Choose[T]): Gen[T]

    A generator that generates a random value in the given (inclusive) range.

    A generator that generates a random value in the given (inclusive) range. If the range is invalid, the generator will not generate any value.

  14. def chooseNum [T] (minT: T, maxT: T, specials: T*)(implicit num: Numeric[T], c: Choose[T]): Gen[T]

    Generates numbers within the given inclusive range, with extra weight on zero, +/- unity, both extremities, and any special numbers provided.

    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.

  15. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def containerOf [C[_], T] (g: Gen[T])(implicit b: Buildable[T, C]): Gen[C[T]]

    Generates a container of any type for which there exists an implicit Buildable instance.

    Generates a container of any type for which there exists an implicit 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.

  17. def containerOf1 [C[_], T] (g: Gen[T])(implicit b: Buildable[T, C]): Gen[C[T]]

    Generates a non-empty container of any type for which there exists an implicit Buildable instance.

    Generates a non-empty container of any type for which there exists an implicit 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.

  18. def containerOfN [C[_], T] (n: Int, g: Gen[T])(implicit b: Buildable[T, C]): Gen[C[T]]

    Generates a container of any type for which there exists an implicit Buildable instance.

    Generates a container of any type for which there exists an implicit Buildable instance. The elements in the container will be generated by the given generator. The size of the generated container is given by n.

  19. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  20. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  21. def fail [T] : Gen[T]

    A generator that never generates a value

  22. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  23. implicit def freqTuple [T] (t: (Int, T)): (Int, Gen[T])

    Attributes
    implicit
  24. def frequency [T] (gs: (Int, Gen[T])*): Gen[T]

    Chooses one of the given generators with a weighted random distribution

  25. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  26. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  27. def identifier : Gen[String]

  28. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  29. def listOf [T] (g: ⇒ Gen[T]): Gen[List[T]]

    Generates a list of random length.

    Generates a list of random length. The maximum length depends on the size parameter. This method is equal to calling containerOf[List,T](g).

  30. def listOf1 [T] (g: ⇒ Gen[T]): Gen[List[T]]

    Generates a non-empty list of random length.

    Generates a non-empty list of random length. The maximum length depends on the size parameter. This method is equal to calling containerOf1[List,T](g).

  31. def listOfN [T] (n: Int, g: Gen[T]): Gen[List[T]]

    Generates a list of the given length.

    Generates a list of the given length. This method is equal to calling containerOfN[List,T](n,g).

  32. def lzy [T] (g: ⇒ Gen[T]): Gen[T] { lazy val h: org.scalacheck.Gen[T] }

    Wraps a generator lazily.

    Wraps a generator lazily. The given parameter is only evalutated once, and not until the wrapper generator is evaluated.

  33. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  34. def negNum [T] (implicit num: Numeric[T], c: Choose[T]): Gen[T]

    Generates negative numbers of uniform distribution, with an lower bound of the negated generation size parameter.

  35. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  36. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  37. def numChar : Gen[Char]

  38. def numStr : Gen[String]

  39. def oneOf [T] (g1: Gen[T], g2: Gen[T], gs: Gen[T]*): Gen[T]

    Picks a random generator from a list

  40. def oneOf [T] (xs: Seq[T]): Gen[T]

    Picks a random value from a list

  41. def parameterized [T] (f: (Params) ⇒ Gen[T]): Gen[T]

    Creates a generator that can access its generation parameters

  42. def pick [T] (n: Int, g1: Gen[T], g2: Gen[T], gs: Gen[T]*): Gen[Seq[T]]

    A generator that picks a given number of elements from a list, randomly

  43. def pick [T] (n: Int, l: Iterable[T]): Gen[Seq[T]]

    A generator that picks a given number of elements from a list, randomly

  44. def posNum [T] (implicit num: Numeric[T], c: Choose[T]): Gen[T]

    Generates positive numbers of uniform distribution, with an upper bound of the generation size parameter.

  45. def resize [T] (s: Int, g: Gen[T]): Gen[T]

    Creates a resized version of a generator

  46. def resultOf [T1, T2, T3, T4, T5, T6, T7, T8, T9, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8], a9: Arbitrary[T9]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  47. def resultOf [T1, T2, T3, T4, T5, T6, T7, T8, R] (f: (T1, T2, T3, T4, T5, T6, T7, T8) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  48. def resultOf [T1, T2, T3, T4, T5, T6, T7, R] (f: (T1, T2, T3, T4, T5, T6, T7) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  49. def resultOf [T1, T2, T3, T4, T5, T6, R] (f: (T1, T2, T3, T4, T5, T6) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  50. def resultOf [T1, T2, T3, T4, T5, R] (f: (T1, T2, T3, T4, T5) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  51. def resultOf [T1, T2, T3, T4, R] (f: (T1, T2, T3, T4) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  52. def resultOf [T1, T2, T3, R] (f: (T1, T2, T3) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  53. def resultOf [T1, T2, R] (f: (T1, T2) ⇒ R)(implicit a1: Arbitrary[T1], a2: Arbitrary[T2]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  54. def resultOf [T, R] (f: (T) ⇒ R)(implicit a: Arbitrary[T]): Gen[R]

    Takes a function and returns a generator that generates arbitrary results of that function by feeding it with arbitrarily generated input parameters.

  55. def sequence [C[_], T] (gs: Iterable[Gen[T]])(implicit b: Buildable[T, C]): Gen[C[T]]

    Sequences generators.

    Sequences generators. If any of the given generators fails, the resulting generator will also fail.

  56. def sized [T] (f: (Int) ⇒ Gen[T]): Gen[T]

    Creates a generator that can access its generation size

  57. def someOf [T] (g1: Gen[T], g2: Gen[T], gs: Gen[T]*): Gen[Seq[T]]

    A generator that picks a random number of elements from a list

  58. def someOf [T] (l: Iterable[T]): Gen[Seq[T]]

    A generator that picks a random number of elements from a list

  59. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  60. def toString (): String

    Definition Classes
    AnyRef → Any
  61. implicit def value [T] (x: T): Gen[T]

    A generator that always generates the given value

    A generator that always generates the given value

    Attributes
    implicit
  62. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  65. def wrap [T] (g: ⇒ Gen[T]): Gen[T]

    Wraps a generator for later evaluation.

    Wraps a generator for later evaluation. The given parameter is evaluated each time the wrapper generator is evaluated.

  66. val defaultParams : Params

    Annotations
    @deprecated
    Deprecated

    Use Gen.Params() instead

  67. def elements [T] (xs: T*): Gen[T]

    A generator that returns a random element from a list

    A generator that returns a random element from a list

    Annotations
    @deprecated
    Deprecated

    Use 'oneOf' with constant generators instead.

  68. def elementsFreq [T] (vs: (Int, T)*): Gen[T]

    Chooses one of the given values, with a weighted random distribution.

    Chooses one of the given values, with a weighted random distribution.

    Annotations
    @deprecated
    Deprecated

    Use 'frequency' with constant generators instead.

  69. def negInt : Gen[Int]

    Annotations
    @deprecated
    Deprecated

    Use negNum[Int] instead

  70. def posInt : Gen[Int]

    Annotations
    @deprecated
    Deprecated

    Use posNum[Int] instead

  71. def vectorOf [T] (n: Int, g: Gen[T]): Gen[List[T]]

    Generates a list of the given length.

    Generates a list of the given length. This method is equal to calling containerOfN[List,T](n,g).

    Annotations
    @deprecated
    Deprecated

    Use 'listOfN' instead.

Inherited from AnyRef

Inherited from Any