ocaml-containers/tests/helpers.ml
Simon Cruanes 11611894e9 heavy modification of Gen's API. Now the default 'a Gen.t is a transient, consumable generator
of 'a, and 'a Gen.Restart.t can be used for restartable generators.
2013-11-11 23:04:10 +01:00

17 lines
454 B
OCaml

(** Some helpers for tests *)
let print_int_list l =
let b = Buffer.create 20 in
Format.bprintf b "@[<h>[%a]@]"
(Sequence.pp_seq ~sep:", " Format.pp_print_int)
(Sequence.of_list l);
Buffer.contents b
let print_int_int_list l =
let printer fmt (i,j) = Format.fprintf fmt "%d, %d" i j in
let b = Buffer.create 20 in
Format.bprintf b "@[<h>[%a]@]"
(Sequence.pp_seq ~sep:", " printer)
(Sequence.of_list l);
Buffer.contents b