Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot committed Feb 28, 2022
1 parent 34d96c5 commit 45dfa65
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/passing/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5023,6 +5023,24 @@
(package ocamlformat)
(action (diff tests/use_file.mlt.err use_file.mlt.stderr)))

(rule
(deps tests/.ocamlformat )
(package ocamlformat)
(action
(with-stdout-to verbatim_comments.ml.stdout
(with-stderr-to verbatim_comments.ml.stderr
(run %{bin:ocamlformat} --margin-check %{dep:tests/verbatim_comments.ml})))))

(rule
(alias runtest)
(package ocamlformat)
(action (diff tests/verbatim_comments.ml.ref verbatim_comments.ml.stdout)))

(rule
(alias runtest)
(package ocamlformat)
(action (diff tests/verbatim_comments.ml.err verbatim_comments.ml.stderr)))

(rule
(deps tests/.ocamlformat )
(enabled_if (<> %{os_type} Win32))
Expand Down
23 changes: 23 additions & 0 deletions test/passing/tests/verbatim_comments.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(*= Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* [...]
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
[...] *)

let _ =
(*= Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* [...]
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
[...] *)
()
23 changes: 23 additions & 0 deletions test/passing/tests/verbatim_comments.ml.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(*= Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* [...]

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
[...] *)

let _ =
(*= Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* [...]

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
[...] *)
()

0 comments on commit 45dfa65

Please sign in to comment.