123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168open!BaseopenTypesmoduleDefinitions=structmoduleInsert_loc=struct(** Whether this expectation is tied to an AST node already present in the source, and
the location information needed to determine where to insert corrections for this
expectation *)typet=|Overwriteof{whole_node:Compact_loc.t;payload:Compact_loc.toption}(** An expectation parsed from the test file and which should be overwritten by
corrections. Corrections to just the payload should overwrite just the [payload]
location, if present. If no [payload] location is present, or for corrections
that change the entire node (e.g. a change from [[%expect _]] to
[[%expect.unreachable]]), overwrite the [whole_node] loc. *)|InsertofVirtual_loc.t(** An expectation not parsed from the file that should be inserted into
[Virtual_loc.loc] and is associated with a test whose body is at
[Virtual_loc.body_loc] *)endmoduleBehavior_type=struct(** The type of expect node *)typet=[`Expect|`Unreachable]endmoduleExpect_reachability=struct(** Whether an expect node expresses an assertion that control flow passes through it
every time a test is run *)typet=|Can_reach(** Test passes even if node is only reached on *some* executions of a test *)|Must_reach(** Test fails unless node is reached by *all* executions of a test *)endmoduleOn_unreachable=struct(** What should be done if this expectation is never reached in the test execution *)typet=|Silent(** Do nothing *)|Delete(** Delete this expectation from the source file *)|Replace_with_unreachable(** Replace this expectation with a [[%expect.unreachable]] node *)endmoduleBehavior=struct(** A ['behavior_type t] describes how to handle a test node when running tests
and writing corrections.
['behavior_type] determines the types of rewrites that are possible at this node.
It is either [`Expect] (indicating that both corrections for unexpected output and
rewrites for unreachability are possible) or [`Unreachable] (indicating that only
corrections for unexpected output are possible).
*)type_t=|Expect:{payload:Output.Payload.t;on_unreachable:On_unreachable.t;reachability:Expect_reachability.t}->[`Expect]t|Unreachable:{reachability_of_corrected:Expect_reachability.t(** The reachability of the node inserted if this unreachable node is
unexpectedly reached *)}->[`Unreachable]tend(** A [('behavior_type) t] carries information about how to run tests for a
specific expect node and rewrite it in the source file if there are corrections. The
['behavior_type] type variable has the same meanings as in
['behavior_type Behavior.t].
*)type'behavior_typet={position:Insert_loc.t;behavior:'behavior_typeBehavior.t;payload_type:Output.Type.t;on_incorrect_output:String_node_format.Shape.t(** The name and syntax style of the extension point or attribute used to write
corrections when receiving "incorrect" output for this test node. For each [t],
there is only one such node. For example, if an [{%expect_exact||}] node is
reached with incorrect output, it is always corrected to a different
[{%expect_exact||}] node, and an [[%expect.unreachable]] that is reached is
always corrected to an [[%expect]] node.
Note that for a node that should be reachable, the correction when it is found to
be unreachable is instead governed by [on_unreachable] in the [Expect] constructor
of [behavior].
*);inconsistent_outputs_message:string}endmoduletypeExpectation=sigincludemoduletypeofstructincludeDefinitionsendmoduleInsert_loc:sigincludemoduletypeofstructincludeInsert_locendvalloc:Insert_loc.t->Compact_loc.tendvalwith_behavior:'old_behaviort->'new_behaviorBehavior.t->'new_behaviort(** [formatter ~expect_node_formatting t] returns the [Output.Formatter.t] that formats
test output according to the type ([exact] or [pretty]) of [t], using information
about the location and payload of [t] for formatting. *)valformatter:expect_node_formatting:Expect_node_formatting.t->_t->Output.Formatter.t(** [[%expect _]] *)valexpect:formatting_flexibility:Expect_node_formatting.Flexibility.t->node_loc:Compact_loc.t->located_payload:(Output.Payload.t*Compact_loc.t)option->[`Expect]t(** [[%expect_exact _]] *)valexpect_exact:formatting_flexibility:Expect_node_formatting.Flexibility.t->node_loc:Compact_loc.t->located_payload:(Output.Payload.t*Compact_loc.t)option->[`Expect]t(** [[%expect.unreachable]] *)valexpect_unreachable:node_loc:Compact_loc.t->[`Unreachable]t(** [[@@expect.uncaught_exn _]] *)valexpect_uncaught_exn:formatting_flexibility:Expect_node_formatting.Flexibility.t->node_loc:Compact_loc.t->located_payload:(Output.Payload.t*Compact_loc.t)option->[`Expect]t(** Runtime representation of the implicit [[%expect {||}]] at the end of every expect
test. *)valexpect_trailing:insert_loc:Virtual_loc.t->[`Expect]t(** Runtime representation of the assertion that a test does not produce uncaught
exceptions, which a user implicitly makes by omitting an [[@@expect.uncaught_exn _]]
attribute. *)valexpect_no_uncaught_exn:insert_loc:Virtual_loc.t->[`Unreachable]tmoduleFor_apply_style:sigtypeformat_payload:=expect_node_formatting:Expect_node_formatting.t->payload_loc:Compact_loc.t->node_loc:Compact_loc.t->String_node_format.Delimiter.t->string->stringoptionvalformat_expect_payload:format_payloadvalformat_uncaught_exn_payload:format_payloadendend