You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Alcotest API exposes the definition of Alcotest.testable as:
(** [TESTABLE] provides an abstract description for testable values. *)module type TESTABLE=sigtypet(** The type to test. *)valpp : tFmt.t(** A way to pretty-print the value. *)valequal : t -> t -> bool(** Test for equality between two values. *)endtype'a testable = (moduleTESTABLEwithtypet='a)
(** The type for testable values. *)valtestable : 'aFmt.t -> ('a -> 'a -> bool) -> 'atestable(** [testable pp eq] is a new {!type-testable} with the pretty-printer [pp] and equality [eq]. *)
This is unfortunate, as it means testables can't keep any additional structure about the underlying type when it's available. For instance:
it's not possible to add structural diffing in failing test output (as drafted by Subcomponent diffing #247), even when using only combinators from the Alcotest API itself.
We should deprecate the concreteness of the testable type and then make it abstract. Users will still be able to construct testables with Alcotest.testable, and to ease migration we can add a new function like Alcotest.testable_of_module that does something equivalent with first-class module syntax.
The text was updated successfully, but these errors were encountered:
The Alcotest API exposes the definition of
Alcotest.testable
as:This is unfortunate, as it means
testable
s can't keep any additional structure about the underlying type when it's available. For instance:neg
combinator results in unhelpful failure logging #300 (i.e. without trying to pack extra information intoequal
/testable
with global mutable state);We should deprecate the concreteness of the
testable
type and then make it abstract. Users will still be able to construct testables withAlcotest.testable
, and to ease migration we can add a new function likeAlcotest.testable_of_module
that does something equivalent with first-class module syntax.The text was updated successfully, but these errors were encountered: