Module Popper.Proposition
Types
Primitives
val pass : t
pass
is a proposition that true
val fail : ?loc:string -> (Stdlib.Format.formatter -> unit -> unit) -> t
fail ?loc pp
is a failing proposition with locationloc
if given and printerpp
for the error message
val fail_with : ?loc:string -> string -> t
fail_with ?loc msg
is a proposition that fails with locationloc
if given and messagemsg
val discard : t
discard
is a proposition that is discarded.
val equal : ?loc:string -> 'a Comparator.t -> 'a -> 'a -> t
equal ?loc cmp x y
returns a propositionpass
only ifx
andy
are equal using the given comparatorcmp
. Ifloc
is passed, it reports the location string in case of failure.
val less_than : ?loc:string -> 'a Comparator.t -> 'a -> 'a -> t
less_than ?loc cmp x y
returns a propositionpass
only ifx
is less thany
when using the given compartorcmp
. Ifloc
is passed, it reports the location string in case of failure.
val greater_than : ?loc:string -> 'a Comparator.t -> 'a -> 'a -> t
greater_than ?loc cmp x y
returns a propositionpass
only ifx
is greater thany
when using the given compartorcmp
. Ifloc
is passed, it reports the location string in case of failure.
val less_equal_than : ?loc:string -> 'a Comparator.t -> 'a -> 'a -> t
less_equal_than ?loc cmp x y
returns a propositionpass
only ifx
is less than or equal toy
when using the given compartorcmp
. Ifloc
is passed, it reports the location string in case of failure.
val greater_equal_than : ?loc:string -> 'a Comparator.t -> 'a -> 'a -> t
greater_equal_than ?loc cmp x y
returns a propositionpass
only ifx
is greater than or equal toy
when using the given compartorcmp
. Ifloc
is passed, it reports the location string in case of failure.
val is_true : ?loc:string -> bool -> t
is_true ?loc b
returns a propositionpass
ifb
istrue
. Otherwisefail
with locationloc
if given.
val is_false : ?loc:string -> bool -> t
is_false ?loc b
returns a propositionpass
ifb
isfalse
. Otherwisefail
with locationloc
if given.