Skip to content

Commit edf3c9d

Browse files
authored
Fix unstable broken-ref test (#1714)
In this test, OCamlformat calls git diff then tries to hide the temporary file names in the output. This didn't work on my system, where temporary files are created into `/run/user/...` instead of `/tmp`.
1 parent 5dd6574 commit edf3c9d

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

lib/Translation_unit.ml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,9 @@ module Error = struct
5555
let n = Filename.temp_file input_name (Printf.sprintf ".next%s" ext) in
5656
Out_channel.write_all p ~data:prev ;
5757
Out_channel.write_all n ~data:next ;
58-
let anonymize =
59-
"sed 's/a\\/tmp\\/[^ ]*/before/g' | sed 's/b\\/tmp\\/[^ ]*/after/g' | \
60-
sed '/index .*/d'"
61-
in
6258
ignore
6359
(Caml.Sys.command
64-
(Printf.sprintf "git diff --no-index -u %S %S | %s 1>&2" p n
65-
anonymize ) ) ;
60+
(Printf.sprintf "git diff --no-index -u %S %S | sed '1,4d' 1>&2" p n) ) ;
6661
Caml.Sys.remove p ;
6762
Caml.Sys.remove n
6863

test/failing/tests/unstable_docstrings.mli.broken-ref

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ ocamlformat: Cannot process "tests/unstable_docstrings.mli".
33
BUG: doc comments changed.
44
File "_none_", line 0, characters -1--1::
55
Error: Formatting of doc-comment is unstable (e.g. parses as a list or not depending on the margin):
6-
diff --git before after
7-
--- before
8-
+++ after
96
@@ -1,6 +1,7 @@
107
Blablabla. Otherwise, the given protocol can not be:
118
- {ul

0 commit comments

Comments
 (0)