Header menu logo testify

CheckOperators Module

Concise operator syntax for property-style checks.

Functions and values

Function or value Description

a <&> b

Full Usage: a <&> b

Parameters:
    a : ^T - The first required expectation.
    b : ^T - The second required expectation.

Returns: ^T A combined expectation that succeeds only when both input expectations succeed.
Modifiers: inline
Type parameters: ^T

Combines two expectations so that both must succeed.

a : ^T

The first required expectation.

b : ^T

The second required expectation.

Returns: ^T

A combined expectation that succeeds only when both input expectations succeed.

a <|> b

Full Usage: a <|> b

Parameters:
    a : ^T - The first alternative expectation.
    b : ^T - The second alternative expectation.

Returns: ^T A combined expectation that succeeds when either input expectation succeeds.
Modifiers: inline
Type parameters: ^T

Combines two expectations so that either one may succeed.

a : ^T

The first alternative expectation.

b : ^T

The second alternative expectation.

Returns: ^T

A combined expectation that succeeds when either input expectation succeeds.

expr |=> reference

Full Usage: expr |=> reference

Parameters:
    expr : Expr<('Args -> 'Testable)> - The quoted tested function under evaluation.
    reference : 'Args -> 'Testable - The trusted reference implementation.

Modifiers: inline
Type parameters: 'Args, 'Testable

Runs the default equality-based throwing property check.

expr : Expr<('Args -> 'Testable)>

The quoted tested function under evaluation.

reference : 'Args -> 'Testable

The trusted reference implementation.

Exception Raised when the property does not pass.
Example

 open Testify.CheckOperators

 <@ List.rev >> List.rev @> |=> id
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
val id: x: 'T -> 'T

expr |=>> reference

Full Usage: expr |=>> reference

Parameters:
    expr : Expr<('Args -> 'Testable)> - The quoted tested function under evaluation.
    reference : 'Args -> 'Testable - The trusted reference implementation.

Returns: Expr<('Args -> 'Testable)> The original quotation.
Modifiers: inline
Type parameters: 'Args, 'Testable

Runs the default equality-based throwing property check, then returns the quotation.

expr : Expr<('Args -> 'Testable)>

The quoted tested function under evaluation.

reference : 'Args -> 'Testable

The trusted reference implementation.

Returns: Expr<('Args -> 'Testable)>

The original quotation.

Exception Raised when the property does not pass.
Example

 open Testify.CheckOperators

 <@ List.rev >> List.rev @> |=>> id |> ignore
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
val id: x: 'T -> 'T
val ignore: value: 'T -> unit

expr |?> buildProperty

Full Usage: expr |?> buildProperty

Parameters:
    expr : Expr<('Args -> bool)> - The quoted bool-returning function under evaluation.
    buildProperty : ('Args -> bool) -> Property - The callback that wraps the supplied verifier in custom FsCheck quantification.

Modifiers: inline
Type parameters: 'Args

Runs a callback-built bool property check and raises immediately on failure.

expr : Expr<('Args -> bool)>

The quoted bool-returning function under evaluation.

buildProperty : ('Args -> bool) -> Property

The callback that wraps the supplied verifier in custom FsCheck quantification.

Exception Raised when the property does not pass.
Example

 open Testify.CheckOperators

 <@ fun (expectedLength, xs) -> List.length xs = expectedLength @>
 |?> (fun verify ->
         FsCheck.Prop.forAll Arbitraries.from<int * int list> verify)
val expectedLength: int
val xs: 'a list
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 length: list: 'T list -> int
Multiple items
val int: value: 'T -> int (requires member op_Explicit)

--------------------
type int = int32

--------------------
type int<'Measure> = int
type 'T list = List<'T>

Type something to start searching.