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
Motivation: the invisible size parameter, which ramps up from 1 to 50 (by default, controllable with --max-size) over the course of a test run, controls both array lengths and the magnitude of generated integers. This means it is not possible to, for example, generate short arrays containing large numbers (e.g. 10 integers that are all in the millions), or long arrays containing small numbers (e.g., 100,000 integers between 0 and 10).
To enable this, we need to allow something like:
t.arrayOf(t.scaleSize(5,t.int.nonNegative))
In which scaleSize(mult, gen) would delegate to gen but with the size parameter multiplied by mult.
Reading the size is useful for creating recursive structures, so we should have that too. See "A generator for bounded trees" in this QuickCheck example.
Other implementations (test.check) also have combinators to set the size to a constant amount (not a multiplier), but I am less clear on why this would be useful.
The text was updated successfully, but these errors were encountered:
Motivation: the invisible size parameter, which ramps up from 1 to 50 (by default, controllable with
--max-size
) over the course of a test run, controls both array lengths and the magnitude of generated integers. This means it is not possible to, for example, generate short arrays containing large numbers (e.g. 10 integers that are all in the millions), or long arrays containing small numbers (e.g., 100,000 integers between 0 and 10).To enable this, we need to allow something like:
In which
scaleSize(mult, gen)
would delegate togen
but with the size parameter multiplied bymult
.Reading the size is useful for creating recursive structures, so we should have that too. See "A generator for bounded trees" in this QuickCheck example.
Other implementations (test.check) also have combinators to set the size to a constant amount (not a multiplier), but I am less clear on why this would be useful.
The text was updated successfully, but these errors were encountered: