Skip to content

Commit

Permalink
Add tests for basic modal modules.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Del Vecchio <[email protected]>
  • Loading branch information
tdelvecchio-jsc committed Jan 21, 2025
1 parent d585ffc commit 1e0ca6b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/passing/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions test/passing/tests/module_modes.mli
Original file line number Diff line number Diff line change
@@ -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
Empty file.
Empty file.

0 comments on commit 1e0ca6b

Please sign in to comment.