@@ -49,42 +49,38 @@ module Definitions = struct
4949 end
5050
5151 module Behavior = struct
52- (* * A [('output, 'behavior_type) behavior] describes how to handle a test node when
53- running tests and writing corrections.
54-
55- ['output] determines the type of payload used when running tests and writing
56- corrections at that node; it is [Payload.String.t] for [expect_exact] nodes and
57- [Payload.Pretty.t] for all other nodes.
52+ (* * A ['behavior_type t] describes how to handle a test node when running tests
53+ and writing corrections.
5854
5955 ['behavior_type] determines the types of rewrites that are possible at this node.
6056 It is either [`Expect] (indicating that both corrections for unexpected output and
6157 rewrites for unreachability are possible) or [`Unreachable] (indicating that only
6258 corrections for unexpected output are possible).
6359 *)
64- type (_, _) t =
60+ type _ t =
6561 | Expect :
66- { payload : 'output Payload .t
62+ { payload : Output. Payload.t
6763 ; on_unreachable : On_unreachable .t
6864 ; reachability : Expect_reachability .t
6965 }
70- -> ( 'output , [ `Expect ]) t
66+ -> [ `Expect ] t
7167 | Unreachable :
7268 { reachability_of_corrected : Expect_reachability .t
7369 (* * The reachability of the node inserted if this unreachable node is
7470 unexpectedly reached *)
7571 }
76- -> ( Payload.Pretty.Contents .t , [ `Unreachable ]) t
72+ -> [ `Unreachable ] t
7773 end
7874
79- (* * A [('output, ' behavior_type) t] carries information about how to run tests for a
75+ (* * A [('behavior_type) t] carries information about how to run tests for a
8076 specific expect node and rewrite it in the source file if there are corrections. The
81- ['output] and [' behavior_type] type variables have the same meanings as in
82- [('output, ' behavior_type) behavior ].
77+ ['behavior_type] type variable has the same meanings as in
78+ [' behavior_type Behavior.t ].
8379 *)
84- type ('output, ' behavior_type) t =
80+ type ' behavior_type t =
8581 { position : Insert_loc .t
86- ; behavior : ( 'output , ' behavior_type) Behavior .t
87- ; payload_type : ( module Payload .Type with type Contents .t = 'output )
82+ ; behavior : ' behavior_type Behavior .t
83+ ; payload_type : Output .Type.t
8884 ; on_incorrect_output : String_node_format.Shape .t
8985 (* * The name and syntax style of the extension point or attribute used to write
9086 corrections when receiving "incorrect" output for this test node. For each [t],
@@ -111,66 +107,57 @@ module type Expectation = sig
111107 include Insert_loc
112108 end
113109
114- val loc : t -> Compact_loc .t
110+ val loc : Insert_loc . t -> Compact_loc .t
115111 end
116112
117- val with_behavior
118- : ('output, 'old_behavior) t
119- -> ('output, 'new_behavior) Behavior. t
120- -> ('output, 'new_behavior) t
113+ val with_behavior : 'old_behavior t -> 'new_behavior Behavior .t -> 'new_behavior t
121114
122115 (* * [formatter ~expect_node_formatting t] returns the [Output.Formatter.t] that formats
123116 test output according to the type ([exact] or [pretty]) of [t], using information
124117 about the location and payload of [t] for formatting. *)
125118 val formatter
126119 : expect_node_formatting:Expect_node_formatting. t
127- -> (_, _) t
120+ -> _ t
128121 -> Output.Formatter. t
129122
130- val loc : _ t -> Compact_loc .t
131-
132123 (* * [[%expect _]] *)
133124 val expect
134- : payload_loc: Compact_loc. t option
135- -> string Payload . t
136- -> Compact_loc. t
137- -> ( Payload.Pretty.Contents. t, [ `Expect ]) t
125+ : formatting_flexibility: Expect_node_formatting.Flexibility. t
126+ -> node_loc: Compact_loc . t
127+ -> located_payload:( Output.Payload. t * Compact_loc. t) option
128+ -> [ `Expect ] t
138129
139130 (* * [[%expect_exact _]] *)
140131 val expect_exact
141- : payload_loc: Compact_loc. t option
142- -> string Payload . t
143- -> Compact_loc. t
144- -> ( Payload.Exact.Contents. t, [ `Expect ]) t
132+ : formatting_flexibility: Expect_node_formatting.Flexibility. t
133+ -> node_loc: Compact_loc . t
134+ -> located_payload:( Output.Payload. t * Compact_loc. t) option
135+ -> [ `Expect ] t
145136
146137 (* * [[%expect.unreachable]] *)
147- val expect_unreachable
148- : Compact_loc. t
149- -> (Payload.Pretty.Contents. t, [ `Unreachable ]) t
138+ val expect_unreachable : node_loc :Compact_loc .t -> [ `Unreachable ] t
150139
151140 (* * [[@@expect.uncaught_exn _]] *)
152141 val expect_uncaught_exn
153- : payload_loc: Compact_loc. t option
154- -> string Payload . t
155- -> Compact_loc. t
156- -> ( Payload.Pretty.Contents. t, [ `Expect ]) t
142+ : formatting_flexibility: Expect_node_formatting.Flexibility. t
143+ -> node_loc: Compact_loc . t
144+ -> located_payload:( Output.Payload. t * Compact_loc. t) option
145+ -> [ `Expect ] t
157146
158147 (* * Runtime representation of the implicit [[%expect {||}]] at the end of every expect
159148 test. *)
160- val expect_trailing : Virtual_loc .t -> ( Payload.Pretty.Contents .t , [ `Expect ]) t
149+ val expect_trailing : insert_loc : Virtual_loc .t -> [ `Expect ] t
161150
162151 (* * Runtime representation of the assertion that a test does not produce uncaught
163152 exceptions, which a user implicitly makes by omitting an [[@@expect.uncaught_exn _]]
164153 attribute. *)
165- val expect_no_uncaught_exn
166- : Virtual_loc. t
167- -> (Payload.Pretty.Contents. t, [ `Unreachable ]) t
154+ val expect_no_uncaught_exn : insert_loc :Virtual_loc .t -> [ `Unreachable ] t
168155
169156 module For_apply_style : sig
170157 type format_payload : =
171158 expect_node_formatting :Expect_node_formatting .t
172159 -> payload_loc :Compact_loc .t
173- -> loc :Compact_loc .t
160+ -> node_loc :Compact_loc .t
174161 -> String_node_format.Delimiter .t
175162 -> string
176163 -> string option
0 commit comments