From feaa8ecf7dd6f4a680cfa7fe08e4a5eaf880003e Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 4 Jul 2022 22:15:13 -0400 Subject: [PATCH] test BV.init --- tests/data/t_bv.ml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/data/t_bv.ml b/tests/data/t_bv.ml index 6cf555e1..f83433f7 100644 --- a/tests/data/t_bv.ml +++ b/tests/data/t_bv.ml @@ -519,6 +519,23 @@ t ~name:(spf "line %d" __LINE__) (fun () -> true) ;; +t ~name:(spf "line %d" __LINE__) (fun () -> + let l = [ 1; 3; 10; 29; 55 ] in + let v = init 120 (fun i -> List.mem i l) in + assert_equal ~printer:(CCFormat.to_string ppli) l (to_sorted_list v); + true) +;; + +q ~name:(spf "line %d" __LINE__) + Q.(small_list small_nat) + (fun l -> + let l = CCList.sort_uniq ~cmp:CCInt.compare l in + let max = 1 + List.fold_left max 0 l in + let v = init max (fun i -> List.mem i l) in + assert_equal ~printer:(CCFormat.to_string ppli) l (to_sorted_list v); + true) +;; + t ~name:(spf "line %d" __LINE__) (fun () -> let bv = empty () in flip bv 0;