test pvec: avoid size explosion

This commit is contained in:
Simon Cruanes 2026-02-14 20:37:24 -05:00
parent 9ec34f8bf8
commit ea5d9bbdf4
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -265,10 +265,14 @@ module Op = struct
( 1, ( 1,
list_small gen_x >|= fun l -> list_small gen_x >|= fun l ->
Append l, size + List.length l ); Append l, size + List.length l );
];
(if size < 10_000 then [
(* flat map can explode, only do it if list isn't too big *)
( 1, ( 1,
list_size (0 -- 5) gen_x >|= fun l -> list_size (0 -- 5) gen_x >|= fun l ->
Flat_map l, size * (1 + List.length l) ); Flat_map l, size * (1 + List.length l) );
]; ] else [])
;
] ]
in in