ScalaCheck
uses implicit cgta.serland.gen.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:
Defines implicit cgta.serland.gen.Arbitrary instances for common types.
ScalaCheck uses implicit cgta.serland.gen.Arbitrary instances when creating properties out of functions with the
Prop.property
method, and when theArbitrary.arbitrary
method is used. For example, the following code requires that there exists an implicitArbitrary[MyClass]
instance:The required implicit definition could look like this:
The factory method
Arbitrary(...)
takes a generator of typeGen[T]
and returns an instance ofArbitrary[T]
.The
Arbitrary
module defines implicit cgta.serland.gen.Arbitrary instances for common types, for convenient use in your properties and generators.