Skip to content

Commit 3b3b3f1

Browse files
committed
add test for multiple signature items
<!-- ps-id: 597fd8ce-d920-40ad-b1e3-2bad11222b23 -->
1 parent bdcee74 commit 3b3b3f1

File tree

2 files changed

+27
-0
lines changed
  • src_test/ppx_deriving

2 files changed

+27
-0
lines changed

src_test/ppx_deriving/errors/run.t

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,19 @@ Cannot find module error
101101
^^^^^^^^^
102102
Error: [%import]: cannot find the module type M in Stuff.S
103103
[1]
104+
105+
Multiple signature items
106+
$ cat >test.ml <<EOF
107+
> [%%import:
108+
> type b = int
109+
> type a = string]
110+
> EOF
111+
112+
OCaml 4.08 reports different numbers.
113+
It's been fixed for later versions in https://github.com/ocaml/ocaml/pull/8541
114+
$ dune build 2>&1 | sed -r 's/(line|character)s? [0-9]+(-[0-9]+)?/\1s %NUMBER%/g'
115+
File "test.ml", lines %NUMBER%, characters %NUMBER%:
116+
1 | [%%import:
117+
2 | type b = int
118+
3 | type a = string]
119+
Error: [] expected

src_test/ppx_deriving/errors_lte_407/run.t

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,14 @@ Cannot find module error
8787
File "test.ml", line 1, characters 34-43:
8888
Error: [%import]: cannot find the module type M in Stuff.S
8989
[1]
90+
91+
Multiple signature items
92+
$ cat >test.ml <<EOF
93+
> [%%import:
94+
> type b = int
95+
> type a = string]
96+
> EOF
97+
$ dune build
98+
File "test.ml", line 1, characters 0-40:
99+
Error: [] expected
100+
[1]

0 commit comments

Comments
 (0)