We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c2f6c6 commit d633724Copy full SHA for d633724
test/test_write.ml
@@ -16,6 +16,11 @@ let to_string_tests =
16
fun () -> test ~suf:"" Fixtures.json_string );
17
]
18
19
+let replace_crlf s =
20
+ (* a bit hacky as it will just remove \r even when not \r\n *)
21
+ let parts = String.split_on_char '\r' s in
22
+ String.concat "" parts
23
+
24
let to_file_tests =
25
let test ?suf expected =
26
let output_file = Filename.temp_file "test_yojson_to_file" ".json" in
@@ -25,7 +30,7 @@ let to_file_tests =
30
let length = in_channel_length ic in
31
let s = really_input_string ic length in
27
32
close_in ic;
28
- s
33
+ replace_crlf s
29
34
in
35
Sys.remove output_file;
36
Alcotest.(check string) __LOC__ expected file_content
0 commit comments