-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC: Make it possible to disable line wrapping in tests (#10841)
* feat(test): Make it possible to disable line wrapping Sometimes cram tests are not reproducible if different platforms output different length errors, in which case even editing out the errors with common tools like `sed` does not help as the wrapping happens before the `sed` invocation runs, thus the message is split over multiple lines. This introduces an option to disable the automatic wrapping of lines. --------- Signed-off-by: Marek Kubica <[email protected]>
- Loading branch information
1 parent
1062748
commit 5d05171
Showing
7 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(* added in OCaml 5.2 *) | ||
let[@warning "-32"] pp_infinity = Int.max_int | ||
|
||
include Stdlib.Format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
val pp_infinity : int | ||
|
||
include module type of Stdlib.Format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Test the behavior of long lines | ||
|
||
In the default output, user input affects on which lines which of the output | ||
lines appear. For example, with a short project name, the line wraps later: | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.17) | ||
> (package | ||
> (name short)) | ||
> EOF | ||
$ dune build | ||
Error: The package short does not have any user defined stanzas attached to | ||
it. If this is intentional, add (allow_empty) to the package definition in | ||
the dune-project file | ||
-> required by _build/default/short.install | ||
-> required by alias all | ||
-> required by alias default | ||
[1] | ||
|
||
With a long project name, there are less words on the line and thus it wraps in | ||
a different position: | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.17) | ||
> (package | ||
> (name verylongnamethatcauseslinewrappingincases)) | ||
> EOF | ||
$ dune build | ||
Error: The package verylongnamethatcauseslinewrappingincases does not have | ||
any user defined stanzas attached to it. If this is intentional, add | ||
(allow_empty) to the package definition in the dune-project file | ||
-> required by | ||
_build/default/verylongnamethatcauseslinewrappingincases.install | ||
-> required by alias all | ||
-> required by alias default | ||
[1] | ||
|
||
Disabling line breaks should thus only break lines where there are explicit | ||
line breaks in the input and not when the line gets too long. | ||
|
||
$ export DUNE_CONFIG__SKIP_LINE_BREAK=enabled | ||
$ dune build | ||
Error: The package verylongnamethatcauseslinewrappingincases does not have any user defined stanzas attached to it. If this is intentional, add (allow_empty) to the package definition in the dune-project file | ||
-> required by _build/default/verylongnamethatcauseslinewrappingincases.install | ||
-> required by alias all | ||
-> required by alias default | ||
[1] |