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<'?209371> * f:Gen<Func<'?209371,'?209372>>) -> Gen<'?209372>
Type parameters: '?209371, '?209372

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

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

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<'?209367> * rows:int * cols:int) -> Gen<'?209367 [,]>
Type parameters: '?209367

Generates a 2D array of the given dimensions.

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

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

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

Generates an array of a specified length.

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

Allows type annotations in LINQ expressions

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

Generates a value with maximum size n.

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

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

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

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

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

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<'?209374> * newSize:int) -> Gen<'?209374>
Type parameters: '?209374

Override the current size of the test.

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

Generates n values of the given size.

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

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<'?209353> * f:Func<'?209353,Gen<'?209354>> * select:Func<'?209353,'?209354,'?209355>) -> Gen<'?209355>
Type parameters: '?209353, '?209354, '?209355
SelectMany(source, f)
Signature: (source:Gen<'?209350> * f:Func<'?209350,Gen<'?209351>>) -> Gen<'?209351>
Type parameters: '?209350, '?209351
Three(generator)
Signature: generator:Gen<'?209382> -> Gen<'?209382 * '?209382 * '?209382>
Type parameters: '?209382

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

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

Construct an Arbitrary instance from a generator and a shrinker.

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

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

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

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

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

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