From 3b3b3f105968b70545eae4a09f0761db0127f50a Mon Sep 17 00:00:00 2001 From: Corentin Leruth Date: Sun, 5 Feb 2023 07:51:52 +0100 Subject: [PATCH] add test for multiple signature items --- src_test/ppx_deriving/errors/run.t | 16 ++++++++++++++++ src_test/ppx_deriving/errors_lte_407/run.t | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/src_test/ppx_deriving/errors/run.t b/src_test/ppx_deriving/errors/run.t index a59764f..e05ef41 100644 --- a/src_test/ppx_deriving/errors/run.t +++ b/src_test/ppx_deriving/errors/run.t @@ -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 < [%%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 diff --git a/src_test/ppx_deriving/errors_lte_407/run.t b/src_test/ppx_deriving/errors_lte_407/run.t index 5ec3a01..da8c997 100644 --- a/src_test/ppx_deriving/errors_lte_407/run.t +++ b/src_test/ppx_deriving/errors_lte_407/run.t @@ -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 < [%%import: + > type b = int + > type a = string] + > EOF + $ dune build + File "test.ml", line 1, characters 0-40: + Error: [] expected + [1]