checkConstraint

Checks constraint to return true value for random generated input parameters with Arbitrary template.

All input arguments of the constraint have to implement Arbitrary template. Argument shrinking is performed if parameter corresponding shrink range is not empty.

If constrained returns false for some parameters set, shrinking is performed and detailed information about the set is thrown with Error.

testCount parameter defines maximum count of test run. Test can end early if there is fail or all possible parameters values are checked.

shrinkCount parameter defines maximum count of shrinking tries. User implementation of Arbitrary!T.shrink function defines speed of minimum fail set search, shrinking isn't performed for empty shrinking ranges.

void
checkConstraint
(
alias constraint
)
(
size_t testsCount = 100
,
size_t shrinkCount = 100
)
if (
isSomeFunction!constraint &&
allHasArbitrary!(ParameterTypeTuple!constraint)
)

Meta