FsCheck


GenExtensions

Namespace: FsCheck

Extension methods to build generators - contains among other the Linq methods.

Static members

Static memberDescription
Apply(generator, f)
Signature: (generator:Gen<'?72793> * f:Gen<Func<'?72793,'?72794>>) -> Gen<'?72794>
Type parameters: '?72793, '?72794

Apply the given Gen function to this generator, aka the applicative <*> operator.

Array2DOf(generator)
Signature: generator:Gen<'?72791> -> Gen<'?72791 [,]>
Type parameters: '?72791

Generates a 2D array. The square root of the size is the maximum number of rows and columns.

Array2DOf(generator, rows, cols)
Signature: (generator:Gen<'?72789> * rows:int * cols:int) -> Gen<'?72789 [,]>
Type parameters: '?72789

Generates a 2D array of the given dimensions.

ArrayOf(generator)
Signature: generator:Gen<'?72787> -> Gen<'?72787 []>
Type parameters: '?72787

Generates an array using the specified generator. The maximum length is size+1.

ArrayOf(generator, length)
Signature: (generator:Gen<'?72785> * length:int) -> Gen<'?72785 []>
Type parameters: '?72785

Generates an array of a specified length.

Cast(g)
Signature: g:Gen<'?72765> -> Gen<'?72765>
Type parameters: '?72765

Allows type annotations in LINQ expressions

Eval(generator, size, random)
Signature: (generator:Gen<'?72761> * size:int * random:StdGen) -> '?72761
Type parameters: '?72761

Generates a value with maximum size n.

Four(generator)
Signature: generator:Gen<'?72806> -> Gen<'?72806 * '?72806 * '?72806 * '?72806>
Type parameters: '?72806

Build a generator that generates a 4-tuple of the values generated by the given generator.

ListOf(generator)
Signature: generator:Gen<'?72781> -> Gen<IList<'?72781>>
Type parameters: '?72781

Generates a list of random length. The maximum length depends on the size parameter.

ListOf(generator, nbOfElements)
Signature: (generator:Gen<'?72779> * nbOfElements:int) -> Gen<IList<'?72779>>
Type parameters: '?72779

Generates a list of given length, containing values generated by the given generator.

NonEmptyListOf(generator)
Signature: generator:Gen<'a> -> Gen<IList<'a>>
Type parameters: 'a

Generates a non-empty list of random length. The maximum length depends on the size parameter.

Resize(generator, newSize)
Signature: (generator:Gen<'?72796> * newSize:int) -> Gen<'?72796>
Type parameters: '?72796

Override the current size of the test.

Sample(generator, size, numberOfSamples)
Signature: (generator:Gen<'?72763> * size:int * numberOfSamples:int) -> '?72763 list
Type parameters: '?72763

Generates n values of the given size.

Select(g, selector)
Signature: (g:Gen<'?72767> * selector:Func<'?72767,'?72768>) -> Gen<'?72768>
Type parameters: '?72767, '?72768

Map the given function to the value in the generator, yielding a new generator of the result type.

SelectMany(source, f, select)
Signature: (source:Gen<'?72775> * f:Func<'?72775,Gen<'?72776>> * select:Func<'?72775,'?72776,'?72777>) -> Gen<'?72777>
Type parameters: '?72775, '?72776, '?72777
SelectMany(source, f)
Signature: (source:Gen<'?72772> * f:Func<'?72772,Gen<'?72773>>) -> Gen<'?72773>
Type parameters: '?72772, '?72773
Three(generator)
Signature: generator:Gen<'?72804> -> Gen<'?72804 * '?72804 * '?72804>
Type parameters: '?72804

Build a generator that generates a 3-tuple of the values generated by the given generator.

ToArbitrary(generator, shrinker)
Signature: (generator:Gen<'?72800> * shrinker:('?72800 -> seq<'?72800>)) -> Arbitrary<'?72800>
Type parameters: '?72800

Construct an Arbitrary instance from a generator and a shrinker.

ToArbitrary(generator)
Signature: generator:Gen<'?72798> -> Arbitrary<'?72798>
Type parameters: '?72798

Construct an Arbitrary instance from a generator. Shrink is not supported for this type.

Two(generator)
Signature: generator:Gen<'?72802> -> Gen<'?72802 * '?72802>
Type parameters: '?72802

Build a generator that generates a 2-tuple of the values generated by the given generator.

Where(g, predicate)
Signature: (g:Gen<'?72770> * predicate:Func<'?72770,bool>) -> Gen<'?72770>
Type parameters: '?72770

Generates a value that satisfies a predicate. This function keeps re-trying by increasing the size of the original generator ad infinitum. Make sure there is a high chance that the predicate is satisfied.

Fork me on GitHub