Skip to content

Commit

Permalink
Generate small Dynarrays in Make
Browse files Browse the repository at this point in the history
  • Loading branch information
jmid committed Dec 19, 2024
1 parent 0d5f894 commit 68b8f40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/dynarray/stm_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,14 @@ module Dynarray_spec (Elem : Elem) = struct

let arb_cmd state : cmd QCheck.arbitrary =
let open Gen in
let mid_int = Gen.int_bound 11_000 in
let arr_idx state = map (fun i -> I i) (int_bound (List.length state - 1)) in
let elem = Elem.arb.gen in
let array elm_gen = Gen.array_size small_nat elm_gen in
let list elm_gen = Gen.list_size small_nat elm_gen in
QCheck.make ~print:show_cmd
(frequency
[ 5, return Create;
5, map2 (fun l x -> Make (l, x)) mid_int elem;
5, map2 (fun l x -> Make (l, x)) small_nat elem;
50, map2 (fun arr_idx elem_idx -> Get (arr_idx, elem_idx)) (arr_idx state) small_nat;
50, map3 (fun arr_idx elem_idx x -> Set (arr_idx, elem_idx, x)) (arr_idx state) small_nat elem;
50, map (fun i -> Is_empty i) (arr_idx state);
Expand Down

0 comments on commit 68b8f40

Please sign in to comment.