Skip to content

Commit feaa8ec

Browse files
committed
test BV.init
1 parent e159719 commit feaa8ec

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/data/t_bv.ml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,23 @@ t ~name:(spf "line %d" __LINE__) (fun () ->
519519
true)
520520
;;
521521

522+
t ~name:(spf "line %d" __LINE__) (fun () ->
523+
let l = [ 1; 3; 10; 29; 55 ] in
524+
let v = init 120 (fun i -> List.mem i l) in
525+
assert_equal ~printer:(CCFormat.to_string ppli) l (to_sorted_list v);
526+
true)
527+
;;
528+
529+
q ~name:(spf "line %d" __LINE__)
530+
Q.(small_list small_nat)
531+
(fun l ->
532+
let l = CCList.sort_uniq ~cmp:CCInt.compare l in
533+
let max = 1 + List.fold_left max 0 l in
534+
let v = init max (fun i -> List.mem i l) in
535+
assert_equal ~printer:(CCFormat.to_string ppli) l (to_sorted_list v);
536+
true)
537+
;;
538+
522539
t ~name:(spf "line %d" __LINE__) (fun () ->
523540
let bv = empty () in
524541
flip bv 0;

0 commit comments

Comments
 (0)