Header menu logo testify

CheckConfig Module

Helpers for building FsCheck configurations used by Testify.Check.

Start with defaultConfig or thorough, then refine the FsCheck run with helpers such as withMaxTest, withEndSize, or replay-specific helpers.

Types

Type Description

NatModifier

Registers a generator for Mini.Nat based on FsCheck non-negative integers.

SmallNat

A tiny natural-number wrapper useful for compact demos and targeted generators.

SmallNatModifier

Registers a generator for SmallNat values smaller than seven.

Functions and values

Function or value Description

CheckConfig.addMiniArbs config

Full Usage: CheckConfig.addMiniArbs config

Parameters:
    config : Config - The base FsCheck configuration to enrich.

Returns: Config A new configuration whose arbitrary map also includes Testify's demo-specific natural-number helpers.
Modifiers: inline

Adds Testify-specific arbitraries such as Mini.Nat and SmallNat to a config.

config : Config

The base FsCheck configuration to enrich.

Returns: Config

A new configuration whose arbitrary map also includes Testify's demo-specific natural-number helpers.

CheckConfig.defaultConfig

Full Usage: CheckConfig.defaultConfig

Returns: Config

The neutral FsCheck configuration used by Testify property checks before any installed transformers are applied.

Returns: Config
Example

 let config = CheckConfig.defaultConfig
val config: obj

CheckConfig.from

Full Usage: CheckConfig.from

Returns: Arbitrary<'T> The resolved arbitrary for 'T from CheckConfig.defaultConfig.

Looks up the arbitrary for a type from the neutral defaultConfig.

Returns: Arbitrary<'T>

The resolved arbitrary for 'T from CheckConfig.defaultConfig.

CheckConfig.fromConfig config

Full Usage: CheckConfig.fromConfig config

Parameters:
    config : Config - The configuration whose arbitrary map should be queried.

Returns: Arbitrary<'T> The resolved arbitrary for 'T from config.

Looks up the arbitrary for a type from the supplied configuration.

config : Config

The configuration whose arbitrary map should be queried.

Returns: Arbitrary<'T>

The resolved arbitrary for 'T from config.

CheckConfig.thorough

Full Usage: CheckConfig.thorough

Returns: Config

A slower but more exhaustive neutral configuration with a larger test count.

Returns: Config
Example

 let config = CheckConfig.thorough
val config: obj

CheckConfig.tryParseReplay text

Full Usage: CheckConfig.tryParseReplay text

Parameters:
    text : string - The replay token string, typically copied from a failing CheckFailure.

Returns: Replay option Some replay value when text matches Testify's replay format; otherwise None.

Parses a replay token emitted by Testify into an FsCheck replay value.

text : string

The replay token string, typically copied from a failing CheckFailure.

Returns: Replay option

Some replay value when text matches Testify's replay format; otherwise None.

CheckConfig.withEndSize size

Full Usage: CheckConfig.withEndSize size

Parameters:
    size : int - The maximum generated size that FsCheck should use.

Returns: Config A new configuration with the supplied end-size limit.

Creates a neutral configuration with the supplied maximum generated size.

size : int

The maximum generated size that FsCheck should use.

Returns: Config

A new configuration with the supplied end-size limit.

CheckConfig.withMaxTest count

Full Usage: CheckConfig.withMaxTest count

Parameters:
    count : int - The maximum number of generated test cases FsCheck should try.

Returns: Config A new configuration with the supplied test-count limit.

Creates a neutral configuration with the supplied maximum number of tests.

count : int

The maximum number of generated test cases FsCheck should try.

Returns: Config

A new configuration with the supplied test-count limit.

Example

 let config = CheckConfig.withMaxTest 25
val config: obj

CheckConfig.withReplay replay

Full Usage: CheckConfig.withReplay replay

Parameters:
    replay : Replay - The recorded FsCheck replay token to embed into a new configuration.

Returns: Config A configuration that reuses the supplied replay information.

Creates a neutral configuration that replays a previously recorded FsCheck run.

replay : Replay

The recorded FsCheck replay token to embed into a new configuration.

Returns: Config

A configuration that reuses the supplied replay information.

CheckConfig.withReplayString text

Full Usage: CheckConfig.withReplayString text

Parameters:
    text : string - The replay token string emitted by a previous failing property check.

Returns: Config option Some replay-enabled configuration when parsing succeeds; otherwise None.

Parses a replay token and returns a replay-enabled configuration when successful.

text : string

The replay token string emitted by a previous failing property check.

Returns: Config option

Some replay-enabled configuration when parsing succeeds; otherwise None.

Example

 let config =
     CheckConfig.withReplayString "Rnd=1,2; Size=None"
val config: obj

Type something to start searching.