Imposing Restrictions
Learn the importance of imposing restrictions and their advantages over transformations.
We'll cover the following...
Why impose restrictions?
A common trait of all default generators is that they’re pretty broad in the data they generate, and from time to time, we’ll want to exclude specific counterexamples. In fact, we already needed to do that when we used the non_empty()
generator to remove empty lists or binaries from the generated data set. Such a filter generator can be implemented with the ?SUCHTHAT(InstanceOfType, TypeGenerator, BooleanExp)
macro.
The ?SUCHTHAT
macro
...Access this course and 1400+ top-rated courses and projects.