cleanup and more tests in CCHeap

This commit is contained in:
Simon Cruanes 2016-07-04 23:25:55 +02:00
parent c3b1d0db38
commit 13f6660373
2 changed files with 15 additions and 2 deletions

View file

@ -64,6 +64,19 @@ end
)
*)
(* test filter *)
(*$QR & ~count:30
Q.(list_of_size Gen.(return 1_000) int) (fun l ->
(* put elements into a heap *)
let h = H.of_seq (Sequence.of_list l) in
let h = H.filter (fun x->x mod 2=0) h in
OUnit.assert_bool "all odd"
(H.to_seq h |> Sequence.for_all (fun x -> x mod 2 = 0));
let l' = extract_list h in
is_sorted l'
)
*)
module type S = sig
type elt
type t