From 1e0ca6baafc17227480e107acfb5132ab0e1fb82 Mon Sep 17 00:00:00 2001 From: Thomas Del Vecchio Date: Fri, 10 Jan 2025 12:18:43 -0500 Subject: [PATCH] Add tests for basic modal modules. Signed-off-by: Thomas Del Vecchio --- test/passing/dune.inc | 36 ++++++++++++++++++++++ test/passing/tests/module_modes.mli | 21 +++++++++++++ test/passing/tests/module_modes.mli.js-ref | 0 test/passing/tests/module_modes.mli.ref | 0 4 files changed, 57 insertions(+) create mode 100644 test/passing/tests/module_modes.mli create mode 100644 test/passing/tests/module_modes.mli.js-ref create mode 100644 test/passing/tests/module_modes.mli.ref diff --git a/test/passing/dune.inc b/test/passing/dune.inc index 9c10956cda..3fbbe502f8 100644 --- a/test/passing/dune.inc +++ b/test/passing/dune.inc @@ -9031,6 +9031,42 @@ (package ocamlformat) (action (diff tests/module_item_spacing.mli.js-err module_item_spacing.mli.js-stderr))) +(rule + (deps tests/.ocamlformat ) + (package ocamlformat) + (action + (with-stdout-to module_modes.mli.stdout + (with-stderr-to module_modes.mli.stderr + (run %{bin:ocamlformat} --margin-check %{dep:tests/module_modes.mli}))))) + +(rule + (alias runtest) + (package ocamlformat) + (action (diff tests/module_modes.mli.ref module_modes.mli.stdout))) + +(rule + (alias runtest) + (package ocamlformat) + (action (diff tests/module_modes.mli.err module_modes.mli.stderr))) + +(rule + (deps tests/.ocamlformat ) + (package ocamlformat) + (action + (with-stdout-to module_modes.mli.js-stdout + (with-stderr-to module_modes.mli.js-stderr + (run %{bin:ocamlformat} --profile=janestreet --enable-outside-detected-project --disable-conf-files %{dep:tests/module_modes.mli}))))) + +(rule + (alias runtest) + (package ocamlformat) + (action (diff tests/module_modes.mli.js-ref module_modes.mli.js-stdout))) + +(rule + (alias runtest) + (package ocamlformat) + (action (diff tests/module_modes.mli.js-err module_modes.mli.js-stderr))) + (rule (deps tests/.ocamlformat ) (package ocamlformat) diff --git a/test/passing/tests/module_modes.mli b/test/passing/tests/module_modes.mli new file mode 100644 index 0000000000..1e1b0b37d7 --- /dev/null +++ b/test/passing/tests/module_modes.mli @@ -0,0 +1,21 @@ +@@ portable + +type t + +val portable : t +val nonportable : t @@ nonportable + +module T : sig + val portable : t + val portable : t @@ nonportable +end + +module T : sig @@ nonportable + val portable : t + val portable : t @@ nonportable +end + +module (T @ nonportable) : sig @@ portable + val portable : t + val nonportable : t @@ nonportable +end diff --git a/test/passing/tests/module_modes.mli.js-ref b/test/passing/tests/module_modes.mli.js-ref new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/passing/tests/module_modes.mli.ref b/test/passing/tests/module_modes.mli.ref new file mode 100644 index 0000000000..e69de29bb2