Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file helpers_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124(** We codify several testing patterns here to make [File_path] testing rigorous. Every
expect test in this library should call one of these helpers. *)open!Core(** An arbitrary input type used by a test. *)moduletypeType=sigtypet[@@derivingcompare,equal,quickcheck,sexp_of]includeInvariant.Swithtypet:=tend(** A path type (e.g. File_path.Part.t, or File_path.t). *)moduletypePath_type=sigtypet[@@derivingquickcheck]includeIdentifiable.Swithtypet:=tincludeInvariant.Swithtypet:=tmoduleExpert:sigvalunchecked_of_canonical_string:string->tendend(** One version of stable serializations for a path type, including containers. *)moduletypeVersion=sigtypet[@@derivinghash]includeStablewithtypet:=tincludeHashable.Stable.V1.Swithtypekey:=tincludeComparable.Stable.V1.Swithtypecomparable:=tandtypecomparator_witness:=comparator_witnessendmoduletypeHelpers=sigmoduletypeType=TypemoduletypePath_type=Path_type(** Tests the given list of constants. Prints them and tests that they pass the path
type's invariant. *)valtest_constants:(modulePath_typewithtypet='a)->'alist->unit(** Tests the type's comparison. Makes sure sorting a list is consistent regardless of
input order. *)valtest_compare:(modulePath_typewithtypet='a)->'alist->unit(** Tests string conversions for a path type. Makes sure they round-trip, satisfy
invariants, raise appropriately, and only allocate when necessary. *)valtest_of_string:(modulePath_type)->stringlist->unit(** Tests the invariant, unchecked "expert" construction, and consistency with
[of_string]'s raising / canonicalizing behavior. *)valtest_invariant:(modulePath_type)->stringlist->unit(** Makes sure container types are constructed appropriately. (e.g., not just [module
Map = String.Map]). *)valtest_containers:(modulePath_typewithtypet='a)->'alist->unit(** Tests a boolean function. Prints [true] and [false] examples. Makes sure both cases
are covered. Tests [correctness] for each input. *)valtest_predicate:input:(moduleTypewithtypet='input)->examples:'inputlist->correctness:('input->bool->unit)->('input->bool)->unit(** Tests a generic function with the given input and output types. Tests [correctness]
for each input. *)valtest:input:(moduleTypewithtypet='input)->output:(moduleTypewithtypet='output)->examples:'inputlist->correctness:('input->'output->unit)->('input->'output)->unit(** All tests sharing a [Bin_shape_universe.t] must have unique bin_shape digests.
Even if not referred to explicitly by clients, this is exported to clarify the
behavior of [test_stable*] below. *)moduleBin_shape_universe:sigtypet(** Creates a fresh [t]. *)valcreate:unit->t(** A single shared [t], allocated on demand. *)valdefault:tLazy.tend(** Tests stable serializations and round-trips for the given examples, and uniqueness
of bin-shape digests. *)valtest_stable_version:?bin_shape_universe:Bin_shape_universe.t(** defaults to [force Bin_shape_universe.default] *)->Source_code_position.t->(moduleVersionwithtypet='a)->'alist->unit(** Tests stable serializations for containers with the given examples, and uniqueness
of bin-shape digests (instantiated at [int] for polymorphic types). *)valtest_stable_containers:?bin_shape_universe:Bin_shape_universe.t(** defaults to [force Bin_shape_universe.default] *)->Source_code_position.t->(moduleVersionwithtypet='a)->'alist->unit(** Functors wrapping the [Type] signature in polymorphic types. *)moduleOption(Type:Type):Typewithtypet=Type.toptionmoduleList(Type:Type):Typewithtypet=Type.tlistmoduleNonempty_list(Type:Type):Typewithtypet=Type.tNonempty_list.tmoduleOr_error(Type:Type):Typewithtypet=Type.tOr_error.tmoduleTuple2(A:Type)(B:Type):Typewithtypet=A.t*B.tmoduleWith_prefix(Type:Type):Typewithtypet=Type.tExamples.With_prefix.tmoduleWith_suffix(Type:Type):Typewithtypet=Type.tExamples.With_suffix.tend