Skip to content

Commit

Permalink
try to fix tests that fail on mac OS
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jul 31, 2020
1 parent 8a60d44 commit 089a1be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(rule
(targets README.md.corrected)
(deps (package containers) (package containers-data) ./src/mdx_runner.exe)
(deps (package containers-data) ./src/mdx_runner.exe)
(action (run ./src/mdx_runner.exe)))

(alias
Expand Down
13 changes: 10 additions & 3 deletions src/mdx_runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
open Printf

let just_copy () =
CCIO.with_out "README.md.corrected" (fun oc ->
CCIO.with_in "README.md" (fun ic ->
CCIO.copy_into ic oc))
let ic = open_in "README.md" in
let len = in_channel_length ic in
let buf = Bytes.create len in
really_input ic buf 0 len;
close_in_noerr ic;

let oc = open_out "README.md.corrected" in
output oc buf 0 len;
flush oc;
close_out_noerr oc

let () =
try
Expand Down
5 changes: 3 additions & 2 deletions src/threads/CCPool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ module Make(P : PARAM) = struct
let sequence_l l = match l with
| [] -> return []
| _ :: _ ->
sequence_ (L_ l) (fun () -> List.map get_nolock_ l)
let l = List.rev l in
sequence_ (L_ l) (fun () -> List.rev_map get_nolock_ l)

(* reverse twice *)
let map_l f l =
Expand Down Expand Up @@ -557,7 +558,7 @@ module Make(P : PARAM) = struct
(*$R
let l = CCList.(1 -- 100_000) in
let l' = l
|> List.map
|> CCList.map
(fun x -> Fut.make (fun () -> 1))
|> Fut.sequence_l
|> Fut.map (List.fold_left (+) 0)
Expand Down

0 comments on commit 089a1be

Please sign in to comment.