mirror of
https://github.com/c-cube/iter.git
synced 2025-12-05 19:00:31 -05:00
fix(test): compatibility fix for 4.02
This commit is contained in:
parent
d3613ecfbf
commit
01ada1f11d
1 changed files with 10 additions and 1 deletions
|
|
@ -1321,11 +1321,20 @@ let sample k seq =
|
|||
if !i < k then Array.sub a 0 (!i + 1)
|
||||
else a
|
||||
|
||||
(*$inject
|
||||
let array_for_all f a =
|
||||
try
|
||||
for i=0 to Array.length a-1 do
|
||||
if not (f a.(i)) then raise Exit
|
||||
done; true
|
||||
with Exit -> false
|
||||
*)
|
||||
|
||||
(*$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_for_all (fun x -> exists ((=) x) seq) a)
|
||||
&& (Array.length a = Pervasives.min (length seq) n) )
|
||||
*)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue