Skip to content

Commit e191cd2

Browse files
committedMar 7, 2025
Add a note to QCheck{,2}.Gen.graft_corners
1 parent c1a9429 commit e191cd2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎src/core/QCheck.mli

+6
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ module Gen : sig
325325
val graft_corners : 'a t -> 'a list -> unit -> 'a t
326326
(** [graft_corners gen l ()] makes a new generator that enumerates
327327
the corner cases in [l] and then behaves like [g].
328+
329+
Note that [graft_corners gen l ()] is stateful, meaning that once the
330+
elements of [l] have been emitted, subsequent calls will not reproduce
331+
them. It is therefore recommended that separate tests each use a fresh
332+
generator.
333+
328334
@since 0.6 *)
329335

330336
val int_pos_corners : int list

‎src/core/QCheck2.mli

+5
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ module Gen : sig
634634
Does not shrink if the test fails on a grafted value.
635635
Shrinks towards [gen] otherwise.
636636
637+
Note that [graft_corners gen l ()] is stateful, meaning that once the
638+
elements of [l] have been emitted, subsequent calls will not reproduce
639+
them. It is therefore recommended that separate tests each use a fresh
640+
generator.
641+
637642
@since 0.6 *)
638643

639644
val int_pos_corners : int list

0 commit comments

Comments
 (0)
Please sign in to comment.