FsCheck


GenExtensions

Namespace: FsCheck
Attributes:
[<AbstractClass>]
[<Sealed>]
[<Extension>]

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

Static members

Static memberDescription
GenExtensions.Apply(generator, f)
Signature: (generator:Gen<'?8092> * f:Gen<Func<'?8092,'?8093>>) -> Gen<'?8093>
Type parameters: '?8092, '?8093 Attributes:
[<Extension>]

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

GenExtensions.Array2DOf(generator)
Signature: generator:Gen<'?8090> -> Gen<'?8090 [,]>
Type parameters: '?8090 Attributes:
[<Extension>]

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

GenExtensions.Array2DOf(...)
Signature: (generator:Gen<'?8088> * rows:int * cols:int) -> Gen<'?8088 [,]>
Type parameters: '?8088 Attributes:
[<Extension>]

Generates a 2D array of the given dimensions.

GenExtensions.ArrayOf(generator)
Signature: generator:Gen<'?8086> -> Gen<'?8086 []>
Type parameters: '?8086 Attributes:
[<Extension>]

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

GenExtensions.ArrayOf(generator, length)
Signature: (generator:Gen<'?8084> * length:int) -> Gen<'?8084 []>
Type parameters: '?8084 Attributes:
[<Extension>]

Generates an array of a specified length.

GenExtensions.Cast(g)
Signature: g:Gen<'?8064> -> Gen<'?8064>
Type parameters: '?8064 Attributes:
[<Extension>]

Allows type annotations in LINQ expressions

GenExtensions.Eval(...)
Signature: (generator:Gen<'?8060> * size:int * random:StdGen) -> '?8060
Type parameters: '?8060 Attributes:
[<Extension>]

Generates a value with maximum size n.

GenExtensions.Four(generator)
Signature: generator:Gen<'?8105> -> Gen<'?8105 * '?8105 * '?8105 * '?8105>
Type parameters: '?8105 Attributes:
[<Extension>]

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

GenExtensions.ListOf(generator)
Signature: generator:Gen<'?8080> -> Gen<IList<'?8080>>
Type parameters: '?8080 Attributes:
[<Extension>]

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

GenExtensions.ListOf(...)
Signature: (generator:Gen<'?8078> * nbOfElements:int) -> Gen<IList<'?8078>>
Type parameters: '?8078 Attributes:
[<Extension>]

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

GenExtensions.NonEmptyListOf(generator)
Signature: generator:Gen<'a> -> Gen<IList<'a>>
Type parameters: 'a Attributes:
[<Extension>]

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

GenExtensions.Or(generator, other)
Signature: (generator:Gen<'?8123> * other:Gen<'?8123>) -> Gen<'?8123>
Type parameters: '?8123 Attributes:
[<Extension>]

Build a generator that generates a value from two generators with qual probability.

GenExtensions.OrNull(generator)
Signature: generator:Gen<'?8125> -> Gen<'?8125>
Type parameters: '?8125 Attributes:
[<Extension>]

Build a generator that generates a value or null

GenExtensions.Resize(generator, newSize)
Signature: (generator:Gen<'?8095> * newSize:int) -> Gen<'?8095>
Type parameters: '?8095 Attributes:
[<Extension>]

Override the current size of the test.

GenExtensions.Sample(...)
Signature: (generator:Gen<'?8062> * size:int * numberOfSamples:int) -> '?8062 list
Type parameters: '?8062 Attributes:
[<Extension>]

Generates n values of the given size.

GenExtensions.Select(g, selector)
Signature: (g:Gen<'?8066> * selector:Func<'?8066,'?8067>) -> Gen<'?8067>
Type parameters: '?8066, '?8067 Attributes:
[<Extension>]

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

GenExtensions.SelectMany(...)
Signature: (source:Gen<'?8074> * f:Func<'?8074,Gen<'?8075>> * select:Func<'?8074,'?8075,'?8076>) -> Gen<'?8076>
Type parameters: '?8074, '?8075, '?8076 Attributes:
[<Extension>]
GenExtensions.SelectMany(source, f)
Signature: (source:Gen<'?8071> * f:Func<'?8071,Gen<'?8072>>) -> Gen<'?8072>
Type parameters: '?8071, '?8072 Attributes:
[<Extension>]
GenExtensions.Three(generator)
Signature: generator:Gen<'?8103> -> Gen<'?8103 * '?8103 * '?8103>
Type parameters: '?8103 Attributes:
[<Extension>]

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

GenExtensions.ToArbitrary(...)
Signature: (generator:Gen<'?8099> * shrinker:('?8099 -> seq<'?8099>)) -> Arbitrary<'?8099>
Type parameters: '?8099 Attributes:
[<Extension>]

Construct an Arbitrary instance from a generator and a shrinker.

GenExtensions.ToArbitrary(generator)
Signature: generator:Gen<'?8097> -> Arbitrary<'?8097>
Type parameters: '?8097 Attributes:
[<Extension>]

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

GenExtensions.Two(generator)
Signature: generator:Gen<'?8101> -> Gen<'?8101 * '?8101>
Type parameters: '?8101 Attributes:
[<Extension>]

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

GenExtensions.Where(g, predicate)
Signature: (g:Gen<'?8069> * predicate:Func<'?8069,bool>) -> Gen<'?8069>
Type parameters: '?8069 Attributes:
[<Extension>]

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.

GenExtensions.Zip(...)
Signature: (generator:Gen<'?8118> * second:Gen<'?8119> * third:Gen<'?8120> * resultSelector:Func<'?8118,'?8119,'?8120,'?8121>) -> Gen<'?8121>
Type parameters: '?8118, '?8119, '?8120, '?8121 Attributes:
[<Extension>]

Combine two generators into a new generator of the result of the given result selector.

GenExtensions.Zip(...)
Signature: (generator:Gen<'?8114> * second:Gen<'?8115> * third:Gen<'?8116>) -> Gen<'?8114 * '?8115 * '?8116>
Type parameters: '?8114, '?8115, '?8116 Attributes:
[<Extension>]

Combine two generators into a generator of 3-tuples.

GenExtensions.Zip(...)
Signature: (generator:Gen<'?8110> * other:Gen<'?8111> * resultSelector:Func<'?8110,'?8111,'?8112>) -> Gen<'?8112>
Type parameters: '?8110, '?8111, '?8112 Attributes:
[<Extension>]

Combine two generators into a new generator of the result of the given result selector.

GenExtensions.Zip(generator, other)
Signature: (generator:Gen<'?8107> * other:Gen<'?8108>) -> Gen<'?8107 * '?8108>
Type parameters: '?8107, '?8108 Attributes:
[<Extension>]

Combine two generators into a generator of pairs.

Fork me on GitHub