Skip to content

add test for multiple signature items #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%:
Copy link
Collaborator Author

@tatchi tatchi Feb 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the line and character numbers agnostic to fix the difference with OCaml 4.08

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]