Skip to content

Commit dd716c5

Browse files
committed
Add optional small parameter to QCheck.{oneof_list,oneof_array} for consistency
1 parent c1c18bc commit dd716c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/QCheck.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,9 +1865,9 @@ let fun4 o1 o2 o3 o4 ret =
18651865
(* Generator combinators *)
18661866

18671867
(** given a list, returns generator that picks at random from list *)
1868-
let oneof_list ?print xs = make ?print (Gen.oneof_list xs)
1868+
let oneof_list ?print ?small xs = make ?print ?small (Gen.oneof_list xs)
18691869
let oneofl ?print ?collect xs = make ?print ?collect (Gen.oneof_list xs)
1870-
let oneof_array ?print xs = make ?print (Gen.oneof_array xs)
1870+
let oneof_array ?print ?small xs = make ?print ?small (Gen.oneof_array xs)
18711871
let oneofa ?print ?collect xs = make ?print ?collect (Gen.oneof_array xs)
18721872

18731873
(** Given a list of generators, returns generator that randomly uses one of the generators

src/core/QCheck.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ val choose : 'a arbitrary list -> 'a arbitrary
17691769
be empty; if it is [Invalid_argument] is raised.
17701770
@deprecated use {!oneof} instead. *)
17711771

1772-
val oneof_list : ?print:'a Print.t -> 'a list -> 'a arbitrary
1772+
val oneof_list : ?print:'a Print.t -> ?small:('a -> int) -> 'a list -> 'a arbitrary
17731773
(** Pick an element randomly in the list.
17741774
@since NEXT_RELEASE *)
17751775

@@ -1778,7 +1778,7 @@ val oneofl : ?print:'a Print.t -> ?collect:('a -> string) ->
17781778
(** Pick an element randomly in the list.
17791779
@deprecated use {!oneof_list} instead. *)
17801780

1781-
val oneof_array : ?print:'a Print.t -> 'a array -> 'a arbitrary
1781+
val oneof_array : ?print:'a Print.t -> ?small:('a -> int) -> 'a array -> 'a arbitrary
17821782
(** Pick an element randomly in the array.
17831783
@since NEXT_RELEASE *)
17841784

0 commit comments

Comments
 (0)