mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
try to fix tests that fail on mac OS
This commit is contained in:
parent
8a60d44946
commit
089a1bec16
3 changed files with 14 additions and 6 deletions
2
dune
2
dune
|
|
@ -1,6 +1,6 @@
|
||||||
(rule
|
(rule
|
||||||
(targets README.md.corrected)
|
(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)))
|
(action (run ./src/mdx_runner.exe)))
|
||||||
|
|
||||||
(alias
|
(alias
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,16 @@
|
||||||
open Printf
|
open Printf
|
||||||
|
|
||||||
let just_copy () =
|
let just_copy () =
|
||||||
CCIO.with_out "README.md.corrected" (fun oc ->
|
let ic = open_in "README.md" in
|
||||||
CCIO.with_in "README.md" (fun ic ->
|
let len = in_channel_length ic in
|
||||||
CCIO.copy_into ic oc))
|
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 () =
|
let () =
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,8 @@ module Make(P : PARAM) = struct
|
||||||
let sequence_l l = match l with
|
let sequence_l l = match l with
|
||||||
| [] -> return []
|
| [] -> 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 *)
|
(* reverse twice *)
|
||||||
let map_l f l =
|
let map_l f l =
|
||||||
|
|
@ -557,7 +558,7 @@ module Make(P : PARAM) = struct
|
||||||
(*$R
|
(*$R
|
||||||
let l = CCList.(1 -- 100_000) in
|
let l = CCList.(1 -- 100_000) in
|
||||||
let l' = l
|
let l' = l
|
||||||
|> List.map
|
|> CCList.map
|
||||||
(fun x -> Fut.make (fun () -> 1))
|
(fun x -> Fut.make (fun () -> 1))
|
||||||
|> Fut.sequence_l
|
|> Fut.sequence_l
|
||||||
|> Fut.map (List.fold_left (+) 0)
|
|> Fut.map (List.fold_left (+) 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue