See User Guide for usage examples
Class that represents a generator.
A property is a generator that generates a property result
Represents a collection of properties, with convenient methods for checking all properties at once.
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 =>
The required implicit definition could look like this:
...
}
val myGen = Arbitrary.arbitrary[MyClass]
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.
Contains combinators for building generators.
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]) }