ScalaCheck 1.0
|
|
scalacheck/Gen.scala
]
object
Gen
extends
TestableMethod Summary | |
def
|
alphaChar : Gen[Char] |
def
|
alphaLowerChar : Gen[Char] |
def
|
alphaNumChar : Gen[Char] |
def
|
alphaUpperChar : Gen[Char] |
def
|
choose
(low : Int, high : Int) : Gen[Int]
A generator that generates a random integer in the given (inclusive)
range.
|
def
|
choose
(low : Double, high : Double) : Gen[Double]
A generator that generates a random integer in the given (inclusive)
range.
|
def
|
elements
[T](xs : T*) : Gen[T]
A generator that returns a random element from a list
|
def
|
elementsFreq
[T](vs : (Int, T)*) : Gen[T]
Chooses one of the given values, with a weighted random distribution.
|
def
|
fail
[T] : Gen[T]
A generator that never generates a value
|
def
|
frequency
[T](gs : (Int, Gen[T])*) : Gen[T]
Chooses one of the given generators, with a weighted random distribution.
|
def
|
identifier : Gen[String] |
def
|
listOf
[T](g : Gen[T]) : Gen[scala.List[T]]
Generates a list of random length. The maximum length depends on the
size parameter
|
def
|
listOf1
[T](g : Gen[T]) : Gen[scala.List[T]]
Generates a non-empty list of random length. The maximum length depends
on the size parameter
|
def
|
numChar : Gen[Char] |
def
|
oneOf
[T](gs : Gen[T]*) : Gen[T]
Picks a random generator from a list
|
def
|
parameterized
[T](f : (Params) => Gen[T]) : Gen[T]
Creates a generator that can access its generation parameters
|
def
|
resize
[T](s : Int, g : Gen[T]) : Gen[T]
Creates a resized version of a generator
|
def
|
sized
[T](f : (Int) => Gen[T]) : Gen[T]
Creates a generator that can access its generation size
|
def
|
value
[T](x : T) : Gen[T]
A generator that always generates a given value
|
def
|
vectorOf
[T](n : Int, g : Gen[T]) : Gen[Seq[T]]
Generates a list of the given length
|
Methods inherited from Testable | |
specify, specify, specify, specify, specify, specify, specify, checkProperties, checkProperties, checkProperties, testCases, allProperties |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Class Summary | |
case class
|
Params
(val size : Int, val rand : RandomGenerator) extends Product
Record that encapsulates all parameters required for data generation
|
Method Details |
ScalaCheck 1.0
|
|