File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 275275 (alias runtest)
276276 (action (diff multilines/test-case .md multilines.actual)))
277277
278+ (rule
279+ (target multilines-mli.actual)
280+ (deps (package mdx) (source_tree multilines-mli))
281+ (action
282+ (with -stdout-to %{ target}
283+ (chdir multilines-mli
284+ (run ocaml-mdx test -- output - test-case.mli)))))
285+
286+ (rule
287+ (alias runtest)
288+ (action (diff multilines-mli/test-case .mli multilines-mli.actual)))
289+
278290(rule
279291 (target non-det.actual)
280292 (deps (package mdx) (source_tree non-det))
Original file line number Diff line number Diff line change 1+ (* *
2+
3+ In OCaml docstring everything is indented with two spaces
4+
5+ Test multi-lines shell commands:
6+
7+ {@sh[
8+ $ for i in `seq 1 10`; do \
9+ > echo $i; \
10+ > done
11+ 1
12+ ...
13+ 10
14+ ]}
15+
16+ This works for normal OCaml fragments:
17+
18+ {[
19+ let rec fact = function
20+ | 1 -> 1
21+ | n -> n * fact (n-1)
22+ ]}
23+
24+ The formatting for multilines in .mli files is the following:
25+ - Everything is indented with two spaces after the column of the opening code
26+ block.
27+
28+ {[
29+ match None with
30+ | None -> ()
31+ | Some a -> match a with
32+ | None -> ()
33+ | Some b -> b
34+ ]}
35+
36+ But it does not work fine for toplevel (see [multilines/test-case.md] for the
37+ correct definition of [fact]):
38+
39+ {[
40+ # let rec fact = function;;
41+ Line 1, characters 24-26:
42+ Error: Syntax error
43+ ]}
44+ *)
You can’t perform that action at this time.
0 commit comments