Skip to content

Commit

Permalink
dropped_attribute test should fail
Browse files Browse the repository at this point in the history
  • Loading branch information
glittershark committed Feb 13, 2025
1 parent c4ad9e8 commit e534780
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
6 changes: 4 additions & 2 deletions test/passing/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3503,7 +3503,8 @@
(action
(with-stdout-to dropped_attribute.ml.stdout
(with-stderr-to dropped_attribute.ml.stderr
(run %{bin:ocamlformat} --margin-check %{dep:tests/dropped_attribute.ml})))))
(with-accepted-exit-codes 1
(run %{bin:ocamlformat} --margin-check %{dep:tests/dropped_attribute.ml}))))))

(rule
(alias runtest)
Expand All @@ -3521,7 +3522,8 @@
(action
(with-stdout-to dropped_attribute.ml.js-stdout
(with-stderr-to dropped_attribute.ml.js-stderr
(run %{bin:ocamlformat} --profile=janestreet --enable-outside-detected-project --disable-conf-files %{dep:tests/dropped_attribute.ml})))))
(with-accepted-exit-codes 1
(run %{bin:ocamlformat} --profile=janestreet --enable-outside-detected-project --disable-conf-files %{dep:tests/dropped_attribute.ml}))))))

(rule
(alias runtest)
Expand Down
5 changes: 5 additions & 0 deletions test/passing/tests/dropped_attribute.ml.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ocamlformat: ignoring "tests/dropped_attribute.ml" (syntax error)
File "tests/dropped_attribute.ml", line 5, characters 22-31:
5 | val foo : (module T [@annot1] with type t = 'a [@annot2]) -> unit
^^^^^^^^^
Error: invalid package type: an attribute cannot go here
5 changes: 5 additions & 0 deletions test/passing/tests/dropped_attribute.ml.js-err
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ocamlformat: ignoring "tests/dropped_attribute.ml" (syntax error)
File "tests/dropped_attribute.ml", line 5, characters 22-31:
5 | val foo : (module T [@annot1] with type t = 'a [@annot2]) -> unit
^^^^^^^^^
Error: invalid package type: an attribute cannot go here
8 changes: 0 additions & 8 deletions test/passing/tests/dropped_attribute.ml.js-ref
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
(* Attributes [[@annot1]] and [[@annot3]] are dropped by the compiler;
an upcoming patch should fix this. *)

module _ : sig
val foo : ((module T with type t = 'a)[@annot2]) -> unit
end = struct
let foo (type a) (module M : T with type t = a[@annot4]) = ()
end
8 changes: 0 additions & 8 deletions test/passing/tests/dropped_attribute.ml.ref
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
(* Attributes [[@annot1]] and [[@annot3]] are dropped by the compiler; an
upcoming patch should fix this. *)

module _ : sig
val foo : ((module T with type t = 'a)[@annot2]) -> unit
end = struct
let foo (type a) (module M : T with type t = a[@annot4]) = ()
end
Empty file.

0 comments on commit e534780

Please sign in to comment.