Add tests.

This commit is contained in:
Drup 2018-03-28 21:53:42 +02:00 committed by Simon Cruanes
parent daa34efd62
commit 2cd8b8fa13

View file

@ -1321,6 +1321,14 @@ let sample k seq =
if !i < k then Array.sub a 0 (!i + 1) if !i < k then Array.sub a 0 (!i + 1)
else a else a
(*$QR
Q.(pair (list int) (1 -- 20)) (fun (l, n) ->
let seq = of_list l in
let a = sample n seq in
(Array.for_all (fun x -> exists ((=) x) seq) a)
&& (Array.length a = Pervasives.min (length seq) n) )
*)
(** {2 Infix functions} *) (** {2 Infix functions} *)
module Infix = struct module Infix = struct