org.scalacheck

Arbitrary

Related Docs: class Arbitrary | package scalacheck

object Arbitrary

Defines implicit org.scalacheck.Arbitrary instances for common types.

ScalaCheck uses implicit org.scalacheck.Arbitrary instances when creating properties out of functions with the Prop.property method, and when the Arbitrary.arbitrary method is used. For example, the following code requires that there exists an implicit Arbitrary[MyClass] instance:

val myProp = Prop.forAll { myClass: MyClass =>
  ...
}

val myGen = Arbitrary.arbitrary[MyClass]

The required implicit definition could look like this:

implicit val arbMyClass: Arbitrary[MyClass] = Arbitrary(...)

The factory method Arbitrary(...) takes a generator of type Gen[T] and returns an instance of Arbitrary[T].

The Arbitrary module defines implicit org.scalacheck.Arbitrary instances for common types, for convenient use in your properties and generators.

Source
Arbitrary.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Arbitrary
  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: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. def apply[T](g: ⇒ Gen[T]): Arbitrary[T]

    Creates an Arbitrary instance

  5. implicit lazy val arbAnyVal: Arbitrary[AnyVal]

    Arbitrary AnyVal

  6. implicit lazy val arbBigDecimal: Arbitrary[BigDecimal]

    Arbitrary BigDecimal

  7. implicit lazy val arbBigInt: Arbitrary[BigInt]

    Arbitrary BigInt

  8. implicit lazy val arbBitSet: Arbitrary[BitSet]

    Arbitrary instance of scala.collection.BitSet

  9. implicit lazy val arbBool: Arbitrary[Boolean]

    Arbitrary instance of Boolean

  10. implicit lazy val arbByte: Arbitrary[Byte]

    Arbitrary instance of Byte

  11. implicit lazy val arbChar: Arbitrary[Char]

    Arbitrary instance of Char

  12. implicit def arbContainer[C[_], T](implicit a: Arbitrary[T], b: Buildable[T, C[T]], t: (C[T]) ⇒ Traversable[T]): Arbitrary[C[T]]

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as lists, arrays, streams, etc).

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as lists, arrays, streams, etc). The maximum size of the container depends on the size generation parameter.

  13. implicit def arbContainer2[C[_, _], T, U](implicit a: Arbitrary[(T, U)], b: Buildable[(T, U), C[T, U]], t: (C[T, U]) ⇒ Traversable[(T, U)]): Arbitrary[C[T, U]]

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as maps).

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as maps). The maximum size of the container depends on the size generation parameter.

  14. implicit lazy val arbDate: Arbitrary[Date]

    Arbitrary instance of Date

  15. implicit lazy val arbDouble: Arbitrary[Double]

    Arbitrary instance of Double

  16. implicit def arbEither[T, U](implicit at: Arbitrary[T], au: Arbitrary[U]): Arbitrary[Either[T, U]]

    Arbitrary instance of the Either type

  17. implicit lazy val arbError: Arbitrary[Error]

    Arbitrary instance of Error

  18. implicit lazy val arbException: Arbitrary[Exception]

    Arbitrary instance of Exception

  19. implicit lazy val arbFloat: Arbitrary[Float]

    Arbitrary instance of Float

  20. implicit def arbFunction1[T1, R](implicit a: Arbitrary[R]): Arbitrary[(T1) ⇒ R]

    Arbitrary instance of Function1

  21. implicit def arbFunction2[T1, T2, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2) ⇒ R]

    Arbitrary instance of Function2

  22. implicit def arbFunction3[T1, T2, T3, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2, T3) ⇒ R]

    Arbitrary instance of Function3

  23. implicit def arbFunction4[T1, T2, T3, T4, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2, T3, T4) ⇒ R]

    Arbitrary instance of Function4

  24. implicit def arbFunction5[T1, T2, T3, T4, T5, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2, T3, T4, T5) ⇒ R]

    Arbitrary instance of Function5

  25. implicit def arbGen[T](implicit a: Arbitrary[T]): Arbitrary[Gen[T]]

    Arbitrary instance of org.scalacheck.Gen

  26. implicit lazy val arbGenParams: Arbitrary[Parameters]

    Arbitrary instance of gen params

  27. implicit lazy val arbInt: Arbitrary[Int]

    Arbitrary instance of Int

  28. implicit lazy val arbLong: Arbitrary[Long]

    Arbitrary instance of Long

  29. implicit lazy val arbNumber: Arbitrary[Number]

    Arbitrary java.lang.Number

  30. implicit def arbOption[T](implicit a: Arbitrary[T]): Arbitrary[Option[T]]

    Arbitrary instance of the Option type

  31. implicit lazy val arbProp: Arbitrary[Prop]

    Generates an arbitrary property

  32. implicit lazy val arbShort: Arbitrary[Short]

    Arbitrary instance of Short

  33. implicit lazy val arbString: Arbitrary[String]

    Arbitrary instance of String

  34. implicit lazy val arbTestParameters: Arbitrary[Parameters]

    Arbitrary instance of test parameters

  35. implicit lazy val arbThrowable: Arbitrary[Throwable]

    Arbitrary instance of Throwable

  36. implicit def arbTuple2[T1, T2](implicit a1: Arbitrary[T1], a2: Arbitrary[T2]): Arbitrary[(T1, T2)]

    Arbitrary instance of 2-tuple

  37. implicit def arbTuple3[T1, T2, T3](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3]): Arbitrary[(T1, T2, T3)]

    Arbitrary instance of 3-tuple

  38. implicit def arbTuple4[T1, T2, T3, T4](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4]): Arbitrary[(T1, T2, T3, T4)]

    Arbitrary instance of 4-tuple

  39. implicit def arbTuple5[T1, T2, T3, T4, T5](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5]): Arbitrary[(T1, T2, T3, T4, T5)]

    Arbitrary instance of 5-tuple

  40. implicit def arbTuple6[T1, T2, T3, T4, T5, T6](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6]): Arbitrary[(T1, T2, T3, T4, T5, T6)]

    Arbitrary instance of 6-tuple

  41. implicit def arbTuple7[T1, T2, T3, T4, T5, T6, T7](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7]): Arbitrary[(T1, T2, T3, T4, T5, T6, T7)]

    Arbitrary instance of 7-tuple

  42. implicit def arbTuple8[T1, T2, T3, T4, T5, T6, T7, T8](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]): Arbitrary[(T1, T2, T3, T4, T5, T6, T7, T8)]

    Arbitrary instance of 8-tuple

  43. implicit def arbTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9](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]): Arbitrary[(T1, T2, T3, T4, T5, T6, T7, T8, T9)]

    Arbitrary instance of 9-tuple

  44. implicit lazy val arbUnit: Arbitrary[Unit]

    Absolutely, totally, 100% arbitrarily chosen Unit.

  45. def arbitrary[T](implicit a: Arbitrary[T]): Gen[T]

    Returns an arbitrary generator for the type T.

  46. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  47. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  51. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  53. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  54. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  55. final def notify(): Unit

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

    Definition Classes
    AnyRef
  57. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  58. def toString(): String

    Definition Classes
    AnyRef → Any
  59. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped