Check Type
Property-style runner that returns a structured CheckResult.
Static members
| Static member |
Description
|
||
Full Usage:
Check.assertPassed result
Parameters:
CheckResult<'Args, 'Actual, 'Expected>
-
The property result to validate.
|
Raises when the supplied property result is not
|
||
Full Usage:
Check.result (expectation, reference, actual, ?config, ?arbitrary)
Parameters:
CheckExpectation<'Args, 'Actual, 'Expected>
-
The relation that should hold between tested code and the reference.
reference : 'Args -> 'Expected
-
The trusted reference implementation. It receives the generated argument value and produces the
expected outcome for comparison.
actual : Expr<('Args -> 'Actual)>
-
The quoted tested function under evaluation.
?config : Config
-
Optional FsCheck configuration override. When omitted, Testify starts from the default configuration
installed through Testify.currentConfiguration() and related configuration helpers. Common
sources are CheckConfig.defaultConfig, CheckConfig.thorough,
CheckConfig.withMaxTest, CheckConfig.withEndSize, and CheckConfig.withReplay.
?arbitrary : Arbitrary<'Args>
-
Optional custom arbitrary used to generate and shrink 'Args. When omitted, Testify resolves
the default arbitrary for 'Args from the effective FsCheck configuration. Common sources are
Arbitraries.from<'T>, Arbitraries.fromGen, Arbitraries.tuple2,
Arbitraries.tuple3, and custom mapped/filter arbitraries.
Returns: CheckResult<'Args, 'Actual, 'Expected>
Passed, Failed, Exhausted, or Errored depending on the FsCheck run
and the observed tested/reference behavior.
|
Runs a property-style check against a reference implementation and returns the structured result.
Use
Example
val result: obj
Multiple items
module List from Microsoft.FSharp.Collections -------------------- type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T with get member IsEmpty: bool with get member Item: index: int -> 'T with get ... val rev: list: 'T list -> 'T list
|
||
Full Usage:
Check.resultBy (buildProperty, expectation, reference, actual, ?config)
Parameters:
('Args -> bool) -> Property
-
A callback that receives the Testify verifier and must build an FsCheck property around it. Use
this for nested or dependent quantification that is awkward to express with one plain
Arbitrary<'Args>.
expectation : CheckExpectation<'Args, 'Actual, 'Expected>
-
The relation that should hold between tested code and the reference.
reference : 'Args -> 'Expected
-
The trusted reference implementation.
actual : Expr<('Args -> 'Actual)>
-
The quoted tested function under evaluation.
?config : Config
-
Optional FsCheck configuration override. resultBy intentionally does not accept an
arbitrary parameter because the custom property builder owns quantification.
Returns: CheckResult<'Args, 'Actual, 'Expected>
Passed, Failed, Exhausted, or Errored depending on the property run.
|
Runs an advanced property-style check where the caller controls the surrounding FsCheck property structure and Testify supplies the per-case verifier.
Example
val result: obj
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int |
||
Full Usage:
Check.should (expectation, reference, actual, ?config, ?arbitrary)
Parameters:
CheckExpectation<'Args, 'Actual, 'Expected>
-
The relation that should hold between tested code and the reference.
reference : 'Args -> 'Expected
-
The trusted reference implementation.
actual : Expr<('Args -> 'Actual)>
-
The quoted tested function under evaluation.
?config : Config
-
Optional FsCheck configuration override. Typical sources are CheckConfig helpers.
?arbitrary : Arbitrary<'Args>
-
Optional custom arbitrary for 'Args. Typical sources are Arbitraries and
Generators helpers.
|
Runs a property-style check against a reference implementation and raises immediately when it does not pass.
Example
Multiple items
module List from Microsoft.FSharp.Collections -------------------- type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T with get member IsEmpty: bool with get member Item: index: int -> 'T with get ... val sort: list: 'T list -> 'T list (requires comparison)
|
||
Full Usage:
Check.shouldBy (buildProperty, expectation, reference, actual, ?config)
Parameters:
('Args -> bool) -> Property
-
The callback that constructs the surrounding FsCheck property.
expectation : CheckExpectation<'Args, 'Actual, 'Expected>
-
The relation that should hold between tested code and the reference.
reference : 'Args -> 'Expected
-
The trusted reference implementation.
actual : Expr<('Args -> 'Actual)>
-
The quoted tested function under evaluation.
?config : Config
-
Optional FsCheck configuration override.
|
Runs a callback-built property check and raises immediately when it does not pass.
Example
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int type 'T list = List<'T>
Multiple items
module List from Microsoft.FSharp.Collections -------------------- type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T with get member IsEmpty: bool with get member Item: index: int -> 'T with get ... val rev: list: 'T list -> 'T list
|
||
Full Usage:
Check.toDisplayString result
Parameters:
CheckResult<'Args, 'Actual, 'Expected>
-
The property result to render.
Returns: string
The configured rendered representation suitable for terminal output or test failures.
|
Renders a property result using the current Testify report options.
|
||
Full Usage:
Check.toDisplayStringWith (options, result)
Parameters:
TestifyReportOptions
-
Rendering options that control output format, verbosity, and related report shaping.
See TestifyReportOptions and its helper modules for available options.
result : CheckResult<'Args, 'Actual, 'Expected>
-
The property result to render.
Returns: string
The configured rendered representation suitable for terminal output or test failures.
|
Renders a property result with the supplied report options.
|
||
Full Usage:
Check.toFailureReport result
Parameters:
CheckResult<'Args, 'Actual, 'Expected>
-
The property result to translate.
Returns: TestifyFailureReport option
Some structured failure report when result is Failed,
Exhausted, or Errored; otherwise None.
|
Converts a failing property result into a structured Testify failure report.
|
testify