You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(documentation snippets are from https://c-cube.github.io/qcheck/0.18/qcheck-core/QCheck/Gen/index.html)
Expected behaviour: generators with "nat" in their names should generate non-negative natural numbers, generators with "pos" should generate strictly positive natural numbers.
The documentation agrees:
val nat_split2 : int -> (int * int) t : ... generates pairs (n1, n2) of natural numbers ...
val pos_split2 : int -> (int * int) t : ... generates pairs (n1, n2) of strictly positive (nonzero) natural numbers ...
What actually happens:
nat_split2 cannot generate zeroes, even though it should (ie. QCheck.Gen.(generate (nat_split2 2)) only generates pairs (1, 1))
pos_split2 can and does generate zeroes, even though it shouldn't (ie. QCheck.Gen.(generate (pos_split2 0)) does not cause errors and generates pairs (0, 0))
The documentation for nat_split2 also states the restriction "raises Invalid_argument unless n >= 2" which should really apply to pos_split2.
The documentation for pos_split2 refers to nat_split2 (... "nat_split2 n generates pairs")
Although it should probably be a separate issue, the counterparts generalized to lists, nat_split and pos_split, don't seem to work at all (regardless if the precondition n <= k is satisfied).
The text was updated successfully, but these errors were encountered:
(documentation snippets are from https://c-cube.github.io/qcheck/0.18/qcheck-core/QCheck/Gen/index.html)
Expected behaviour: generators with "nat" in their names should generate non-negative natural numbers, generators with "pos" should generate strictly positive natural numbers.
The documentation agrees:
val nat_split2 : int -> (int * int) t
: ... generates pairs (n1, n2) of natural numbers ...val pos_split2 : int -> (int * int) t
: ... generates pairs (n1, n2) of strictly positive (nonzero) natural numbers ...What actually happens:
QCheck.Gen.(generate (nat_split2 2))
only generates pairs(1, 1)
)QCheck.Gen.(generate (pos_split2 0))
does not cause errors and generates pairs(0, 0)
)nat_split2
also states the restriction "raises Invalid_argument unless n >= 2" which should really apply topos_split2
.pos_split2
refers tonat_split2
(... "nat_split2 n
generates pairs")Although it should probably be a separate issue, the counterparts generalized to lists,
nat_split
andpos_split
, don't seem to work at all (regardless if the preconditionn <= k
is satisfied).The text was updated successfully, but these errors were encountered: