Skip to content

Commit

Permalink
test: Add pre42_syntax.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow committed Nov 20, 2024
1 parent 483f48f commit 4fd49e6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/passing/gen/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3712,6 +3712,21 @@
(alias runtest)
(action (diff polytypes.ml.err polytypes.ml.stderr)))

(rule
(deps .ocamlformat dune-project)
(action
(with-stdout-to pre42_syntax.ml.stdout
(with-stderr-to pre42_syntax.ml.stderr
(run %{bin:ocamlformat} --name pre42_syntax.ml --margin-check --ocaml-version=4.1 %{dep:../tests/pre42_syntax.ml})))))

(rule
(alias runtest)
(action (diff pre42_syntax.ml.ref pre42_syntax.ml.stdout)))

(rule
(alias runtest)
(action (diff pre42_syntax.ml.err pre42_syntax.ml.stderr)))

(rule
(deps .ocamlformat dune-project)
(action
Expand Down
4 changes: 4 additions & 0 deletions test/passing/refs.default/pre42_syntax.ml.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type nonrec = nonrec
(** The [nonrec] keyword has been added in OCaml 4.2. *)

let nonrec nonrec : nonrec = nonrec
4 changes: 4 additions & 0 deletions test/passing/refs.janestreet/pre42_syntax.ml.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(** The [nonrec] keyword has been added in OCaml 4.2. *)
type nonrec = nonrec

let nonrec nonrec : nonrec = nonrec
4 changes: 4 additions & 0 deletions test/passing/refs.ocamlformat/pre42_syntax.ml.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(** The [nonrec] keyword has been added in OCaml 4.2. *)
type nonrec = nonrec

let nonrec nonrec : nonrec = nonrec
3 changes: 3 additions & 0 deletions test/passing/tests/pre42_syntax.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(** The [nonrec] keyword has been added in OCaml 4.2. *)
type nonrec = nonrec
let nonrec nonrec : nonrec = nonrec
1 change: 1 addition & 0 deletions test/passing/tests/pre42_syntax.ml.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ocaml-version=4.1

0 comments on commit 4fd49e6

Please sign in to comment.