Object/Trait

org.scalatest.prop

Checkers

Related Docs: trait Checkers | package prop

Permalink

object Checkers extends Checkers

Companion object that facilitates the importing of Checkers members as an alternative to mixing it in. One use case is to import Checkers members so you can use them in the Scala interpreter.

Source
Checkers.scala
Linear Supertypes
Checkers, Configuration, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Checkers
  2. Checkers
  3. Configuration
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class MaxDiscardedFactor(value: PosZDouble) extends PropertyCheckConfigParam with Product with Serializable

    Permalink
    Definition Classes
    Configuration
  2. case class MinSize(value: PosZInt) extends PropertyCheckConfigParam with Product with Serializable

    Permalink

    A PropertyCheckConfigParam that specifies the minimum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    A PropertyCheckConfigParam that specifies the minimum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Definition Classes
    Configuration
    Exceptions thrown

    IllegalArgumentException if specified value is less than zero.

  3. case class MinSuccessful(value: PosInt) extends PropertyCheckConfigParam with Product with Serializable

    Permalink

    A PropertyCheckConfigParam that specifies the minimum number of successful property evaluations required for the property to pass.

    A PropertyCheckConfigParam that specifies the minimum number of successful property evaluations required for the property to pass.

    Definition Classes
    Configuration
  4. sealed abstract class PropertyCheckConfigParam extends Product with Serializable

    Permalink

    Abstract class defining a family of configuration parameters for property checks.

    Abstract class defining a family of configuration parameters for property checks.

    The subclasses of this abstract class are used to pass configuration information to the forAll methods of traits PropertyChecks (for ScalaTest-style property checks) and Checkers(for ScalaCheck-style property checks).

    Definition Classes
    Configuration
  5. case class PropertyCheckConfiguration(minSuccessful: PosInt = PosInt(10), maxDiscardedFactor: PosZDouble = PosZDouble(5.0), minSize: PosZInt = PosZInt(0), sizeRange: PosZInt = PosZInt(100), workers: PosInt = PosInt(1)) extends PropertyCheckConfigurable with Product with Serializable

    Permalink
    Definition Classes
    Configuration
  6. case class SizeRange(value: PosZInt) extends PropertyCheckConfigParam with Product with Serializable

    Permalink

    A PropertyCheckConfigParam that (with minSize) specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    A PropertyCheckConfigParam that (with minSize) specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Note that the size range is added to minSize in order to calculate the maximum size passed to ScalaCheck. Using a range allows compile-time checking of a non-negative number being specified.

    Definition Classes
    Configuration
  7. case class Workers(value: PosInt) extends PropertyCheckConfigParam with Product with Serializable

    Permalink

    A PropertyCheckConfigParam that specifies the number of worker threads to use when evaluating a property.

    A PropertyCheckConfigParam that specifies the number of worker threads to use when evaluating a property.

    Definition Classes
    Configuration
    Exceptions thrown

    IllegalArgumentException if specified value is less than or equal to zero.

  8. case class MaxDiscarded(value: Int) extends PropertyCheckConfigParam with Product with Serializable

    Permalink

    A PropertyCheckConfigParam that specifies the maximum number of discarded property evaluations allowed during property evaluation.

    A PropertyCheckConfigParam that specifies the maximum number of discarded property evaluations allowed during property evaluation.

    In GeneratorDrivenPropertyChecks, a property evaluation is discarded if it throws DiscardedEvaluationException, which is produce by whenever clause that evaluates to false. For example, consider this ScalaTest property check:

    // forAll defined in GeneratorDrivenPropertyChecks
    forAll { (n: Int) =>
      whenever (n > 0) {
        doubleIt(n) should equal (n * 2)
      }
    }
    

    In the above code, whenever a non-positive n is passed, the property function will complete abruptly with DiscardedEvaluationException.

    Similarly, in Checkers, a property evaluation is discarded if the expression to the left of ScalaCheck's ==> operator is false. Here's an example:

    // forAll defined in Checkers
    forAll { (n: Int) =>
      (n > 0) ==> doubleIt(n) == (n * 2)
    }
    

    For either kind of property check, MaxDiscarded indicates the maximum number of discarded evaluations that will be allowed. As soon as one past this number of evaluations indicates it needs to be discarded, the property check will fail.

    Definition Classes
    Configuration
    Annotations
    @deprecated
    Deprecated
    Exceptions thrown

    IllegalArgumentException if specified value is less than zero.

  9. case class MaxSize(value: Int) extends PropertyCheckConfigParam with Product with Serializable

    Permalink

    A PropertyCheckConfigParam that specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    A PropertyCheckConfigParam that specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Note that the maximum size should be greater than or equal to the minimum size. This requirement is enforced by the PropertyCheckConfig constructor and the forAll methods of traits PropertyChecks and Checkers. In other words, it is enforced at the point both a maximum and minimum size are provided together.

    Definition Classes
    Configuration
    Annotations
    @deprecated
    Deprecated

    use SizeRange instead

    Exceptions thrown

    IllegalArgumentException if specified value is less than zero.

  10. case class PropertyCheckConfig(minSuccessful: Int = 10, maxDiscarded: Int = 500, minSize: Int = 0, maxSize: Int = 100, workers: Int = 1) extends PropertyCheckConfigurable with Product with Serializable

    Permalink

    Configuration object for property checks.

    Configuration object for property checks.

    The default values for the parameters are:

    minSuccessful 100
    maxDiscarded 500
    minSize 0
    maxSize 100
    workers 1

    minSuccessful

    the minimum number of successful property evaluations required for the property to pass.

    maxDiscarded

    the maximum number of discarded property evaluations allowed during a property check

    minSize

    the minimum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    maxSize

    the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    workers

    specifies the number of worker threads to use during property evaluation

    Definition Classes
    Configuration
    Annotations
    @deprecated
    Deprecated

    Use PropertyCheckConfiguration instead

    Exceptions thrown

    IllegalArgumentException if the specified minSuccessful value is less than or equal to zero, the specified maxDiscarded value is less than zero, the specified minSize value is less than zero, the specified maxSize value is less than zero, the specified minSize is greater than the specified or default value of maxSize, or the specified workers value is less than or equal to zero.

  11. trait PropertyCheckConfigurable extends AnyRef

    Permalink
    Definition Classes
    Configuration
    Annotations
    @deprecated
    Deprecated

    Use PropertyCheckConfiguration directly instead.

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. implicit def PropertyCheckConfig2PropertyCheckConfiguration(p: PropertyCheckConfig): PropertyCheckConfiguration

    Permalink

    Implicitly converts PropertyCheckConfigs to PropertyCheckConfiguration, which enables a smoother upgrade path.

    Implicitly converts PropertyCheckConfigs to PropertyCheckConfiguration, which enables a smoother upgrade path.

    Definition Classes
    Configuration
  5. object PropertyCheckConfiguration extends Serializable

    Permalink
    Definition Classes
    Configuration
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def check[ASSERTION](p: Prop, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Check a property.

    Check a property.

    p

    the property to check

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  8. def check[ASSERTION](p: Prop, prms: Parameters)(implicit asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Check a property with the given testing parameters.

    Check a property with the given testing parameters.

    p

    the property to check

    prms

    the test parameters

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  9. def check[A1, A2, A3, A4, A5, A6, P, ASSERTION](f: (A1, A2, A3, A4, A5, A6) ⇒ P, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, p: (P) ⇒ Prop, a1: Arbitrary[A1], s1: Shrink[A1], pp1: (A1) ⇒ Pretty, a2: Arbitrary[A2], s2: Shrink[A2], pp2: (A2) ⇒ Pretty, a3: Arbitrary[A3], s3: Shrink[A3], pp3: (A3) ⇒ Pretty, a4: Arbitrary[A4], s4: Shrink[A4], pp4: (A4) ⇒ Pretty, a5: Arbitrary[A5], s5: Shrink[A5], pp5: (A5) ⇒ Pretty, a6: Arbitrary[A6], s6: Shrink[A6], pp6: (A6) ⇒ Pretty, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Convert the passed 6-arg function into a property, and check it.

    Convert the passed 6-arg function into a property, and check it.

    f

    the function to be converted into a property and checked

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  10. def check[A1, A2, A3, A4, A5, P, ASSERTION](f: (A1, A2, A3, A4, A5) ⇒ P, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, p: (P) ⇒ Prop, a1: Arbitrary[A1], s1: Shrink[A1], pp1: (A1) ⇒ Pretty, a2: Arbitrary[A2], s2: Shrink[A2], pp2: (A2) ⇒ Pretty, a3: Arbitrary[A3], s3: Shrink[A3], pp3: (A3) ⇒ Pretty, a4: Arbitrary[A4], s4: Shrink[A4], pp4: (A4) ⇒ Pretty, a5: Arbitrary[A5], s5: Shrink[A5], pp5: (A5) ⇒ Pretty, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Convert the passed 5-arg function into a property, and check it.

    Convert the passed 5-arg function into a property, and check it.

    f

    the function to be converted into a property and checked

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  11. def check[A1, A2, A3, A4, P, ASSERTION](f: (A1, A2, A3, A4) ⇒ P, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, p: (P) ⇒ Prop, a1: Arbitrary[A1], s1: Shrink[A1], pp1: (A1) ⇒ Pretty, a2: Arbitrary[A2], s2: Shrink[A2], pp2: (A2) ⇒ Pretty, a3: Arbitrary[A3], s3: Shrink[A3], pp3: (A3) ⇒ Pretty, a4: Arbitrary[A4], s4: Shrink[A4], pp4: (A4) ⇒ Pretty, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Convert the passed 4-arg function into a property, and check it.

    Convert the passed 4-arg function into a property, and check it.

    f

    the function to be converted into a property and checked

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  12. def check[A1, A2, A3, P, ASSERTION](f: (A1, A2, A3) ⇒ P, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, p: (P) ⇒ Prop, a1: Arbitrary[A1], s1: Shrink[A1], pp1: (A1) ⇒ Pretty, a2: Arbitrary[A2], s2: Shrink[A2], pp2: (A2) ⇒ Pretty, a3: Arbitrary[A3], s3: Shrink[A3], pp3: (A3) ⇒ Pretty, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Convert the passed 3-arg function into a property, and check it.

    Convert the passed 3-arg function into a property, and check it.

    f

    the function to be converted into a property and checked

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  13. def check[A1, A2, P, ASSERTION](f: (A1, A2) ⇒ P, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, p: (P) ⇒ Prop, a1: Arbitrary[A1], s1: Shrink[A1], pp1: (A1) ⇒ Pretty, a2: Arbitrary[A2], s2: Shrink[A2], pp2: (A2) ⇒ Pretty, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Convert the passed 2-arg function into a property, and check it.

    Convert the passed 2-arg function into a property, and check it.

    f

    the function to be converted into a property and checked

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  14. def check[A1, P, ASSERTION](f: (A1) ⇒ P, configParams: PropertyCheckConfigParam*)(implicit config: PropertyCheckConfigurable, p: (P) ⇒ Prop, a1: Arbitrary[A1], s1: Shrink[A1], pp1: (A1) ⇒ Pretty, asserting: CheckerAsserting[ASSERTION], prettifier: Prettifier, pos: Position): Result

    Permalink

    Convert the passed 1-arg function into a property, and check it.

    Convert the passed 1-arg function into a property, and check it.

    f

    the function to be converted into a property and checked

    Definition Classes
    Checkers
    Exceptions thrown

    TestFailedException if a test case is discovered for which the property doesn't hold.

  15. def clone(): AnyRef

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. implicit val generatorDrivenConfig: PropertyCheckConfiguration

    Permalink

    Implicit PropertyCheckConfig value providing default configuration values.

    Implicit PropertyCheckConfig value providing default configuration values.

    Definition Classes
    Configuration
  20. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  23. def maxDiscardedFactor(value: PosZDouble): MaxDiscardedFactor

    Permalink

    Returns a MaxDiscardedFactor property check configuration parameter containing the passed value, which specifies the factor of discarded property evaluations allowed during property evaluation.

    Returns a MaxDiscardedFactor property check configuration parameter containing the passed value, which specifies the factor of discarded property evaluations allowed during property evaluation.

    Definition Classes
    Configuration
  24. def minSize(value: PosZInt): MinSize

    Permalink

    Returns a MinSize property check configuration parameter containing the passed value, which specifies the minimum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Returns a MinSize property check configuration parameter containing the passed value, which specifies the minimum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Definition Classes
    Configuration
  25. def minSuccessful(value: PosInt): MinSuccessful

    Permalink

    Returns a MinSuccessful property check configuration parameter containing the passed value, which specifies the minimum number of successful property evaluations required for the property to pass.

    Returns a MinSuccessful property check configuration parameter containing the passed value, which specifies the minimum number of successful property evaluations required for the property to pass.

    Definition Classes
    Configuration
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def sizeRange(value: PosZInt): SizeRange

    Permalink

    Returns a SizeRange property check configuration parameter containing the passed value, that (with minSize) specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Returns a SizeRange property check configuration parameter containing the passed value, that (with minSize) specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Note that the size range is added to minSize in order to calculate the maximum size passed to ScalaCheck. Using a range allows compile-time checking of a non-negative number being specified.

    Definition Classes
    Configuration
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def workers(value: PosInt): Workers

    Permalink

    Returns a Workers property check configuration parameter containing the passed value, which specifies the number of worker threads to use when evaluating a property.

    Returns a Workers property check configuration parameter containing the passed value, which specifies the number of worker threads to use when evaluating a property.

    Definition Classes
    Configuration

Deprecated Value Members

  1. def maxDiscarded(value: Int): MaxDiscarded

    Permalink

    Returns a MaxDiscarded property check configuration parameter containing the passed value, which specifies the maximum number of discarded property evaluations allowed during property evaluation.

    Returns a MaxDiscarded property check configuration parameter containing the passed value, which specifies the maximum number of discarded property evaluations allowed during property evaluation.

    Definition Classes
    Configuration
    Annotations
    @deprecated
    Deprecated

    use maxDiscardedFactor instead

    Exceptions thrown

    IllegalArgumentException if specified value is less than zero.

  2. def maxSize(value: Int): MaxSize

    Permalink

    Returns a MaxSize property check configuration parameter containing the passed value, which specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Returns a MaxSize property check configuration parameter containing the passed value, which specifies the maximum size parameter to provide to ScalaCheck, which it will use when generating objects for which size matters (such as strings or lists).

    Note that the maximum size should be greater than or equal to the minimum size. This requirement is enforced by the PropertyCheckConfig constructor and the forAll methods of traits PropertyChecks and Checkers. In other words, it is enforced at the point both a maximum and minimum size are provided together.

    Definition Classes
    Configuration
    Annotations
    @deprecated
    Deprecated

    use SizeRange instead

    Exceptions thrown

    IllegalArgumentException if specified value is less than zero.

Inherited from Checkers

Inherited from Configuration

Inherited from AnyRef

Inherited from Any

Ungrouped