more doc and test for CCRandom

This commit is contained in:
Simon Cruanes 2016-04-18 15:05:59 +02:00
parent dba88f5302
commit 2f196ee9a2
2 changed files with 9 additions and 1 deletions

View file

@ -118,6 +118,13 @@ let split_list i ~len st =
else
None
(*$Q
Q.(pair small_int small_int) (fun (i,j) -> \
let len, n = min i j, max i j in \
let l = QCheck.Gen.generate1 (split_list n ~len) in \
match l with None -> true | Some l -> l<> [] && List.for_all (fun x->x>0) l)
*)
let retry ?(max=10) g st =
let rec aux n =
match g st with

View file

@ -102,7 +102,8 @@ val split : int -> (int * int) option t
val split_list : int -> len:int -> int list option t
(** Split a value [n] into a list of values whose sum is [n]
and whose length is [length].
and whose length is [length]. The list is never empty and does not
contain [0].
@return [None] if the value is too small *)
val retry : ?max:int -> 'a option t -> 'a option t