Skip to content

Commit

Permalink
add test for multiple signature items
Browse files Browse the repository at this point in the history
<!-- ps-id: 597fd8ce-d920-40ad-b1e3-2bad11222b23 -->
  • Loading branch information
tatchi committed Feb 23, 2023
1 parent bdcee74 commit 2e9a5a0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src_test/ppx_deriving/errors/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,19 @@ Cannot find module error
^^^^^^^^^
Error: [%import]: cannot find the module type M in Stuff.S
[1]

Multiple signature items
$ cat >test.ml <<EOF
> [%%import:
> type b = int
> type a = string]
> EOF

OCaml 4.08 reports different numbers.
It's been fixed for later versions in https://github.com/ocaml/ocaml/pull/8541
$ dune build 2>&1 | sed -r 's/(line|character)s? [0-9]+(-[0-9]+)?/\1s %NUMBER%/g'
File "test.ml", lines %NUMBER%, characters %NUMBER%:
1 | [%%import:
2 | type b = int
3 | type a = string]
Error: [] expected
11 changes: 11 additions & 0 deletions src_test/ppx_deriving/errors_lte_407/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,14 @@ Cannot find module error
File "test.ml", line 1, characters 34-43:
Error: [%import]: cannot find the module type M in Stuff.S
[1]

Multiple signature items
$ cat >test.ml <<EOF
> [%%import:
> type b = int
> type a = string]
> EOF
$ dune build
File "test.ml", line 1, characters 0-40:
Error: [] expected
[1]

0 comments on commit 2e9a5a0

Please sign in to comment.