From b06ae52071ce20212fa328aa5e36b3c5301d0f97 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 22 Feb 2017 13:48:13 +0100 Subject: [PATCH] new test for `CCPool` --- src/threads/CCPool.ml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/threads/CCPool.ml b/src/threads/CCPool.ml index fa5b3192..2bd4101a 100644 --- a/src/threads/CCPool.ml +++ b/src/threads/CCPool.ml @@ -498,6 +498,19 @@ module Make(P : PARAM) = struct OUnit.assert_raises Exit (fun () -> Fut.get l') *) + (*$R + let rec fib x = if x<2 then 1 else fib (x-1)+fib(x-2) in + let l = + CCList.(1--10_000) + |> List.rev_map + (fun x-> Fut.make (fun () -> Thread.yield(); fib (x mod 30))) + |> Fut.(map_l (fun x->x>|= fun x->x+1)) + in + OUnit.assert_bool "not done" (Fut.state l = Waiting); + let l' = Fut.get l in + OUnit.assert_equal 10_000 (List.length l'); + *) + let choose_ : type a. a t array_or_list -> a t = fun aol ->