org

scalacheck

package scalacheck

Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class Arbitrary[T] extends AnyRef

  2. case class Arg[+T](label: String, arg: T, shrinks: Int, origArg: T)(implicit prettyPrinter: (T) ⇒ Pretty) extends Product with Serializable

  3. trait Choose[T] extends AnyRef

  4. trait Commands extends Prop

    See User Guide for usage examples

  5. class ConsoleReporter extends TestCallback

  6. sealed trait FiniteGen[+T] extends Gen[FiniteGenRes[T]]

  7. case class FiniteGenRes[+T](r: T) extends Product with Serializable

  8. sealed trait Gen[+T] extends AnyRef

    Class that represents a generator.

  9. sealed trait Pretty extends AnyRef

  10. trait Prop extends AnyRef

    A property is a generator that generates a property result

  11. class Properties extends Prop

    Represents a collection of properties, with convenient methods for checking all properties at once.

    Represents a collection of properties, with convenient methods for checking all properties at once. This class is itself a property, which holds if and only if all of the contained properties hold.

    Properties are added in the following way:

    object MyProps extends Properties("MyProps") { property("myProp1") = forAll { (n:Int, m:Int) => n+m == m+n } property("myProp2") = ((0/1) throws classOf[ArithmeticException]) }

  12. class ScalaCheckFramework extends Framework

  13. sealed abstract class Shrink[T] extends AnyRef

Value Members

  1. object Arbitrary

    Defines implicit Arbitrary instances for common types.

    Defines implicit Arbitrary instances for common types.

    ScalaCheck uses implicit 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 Arbitrary instances for common types, for convenient use in your properties and generators.

  2. object Choose

  3. object ConsoleReporter

  4. object Gen

    Contains combinators for building generators.

  5. object Pretty

  6. object Prop

  7. object Shrink

  8. object Test

  9. package util

Ungrouped