GalaxyCheck
GalaxyCheck copied to clipboard
Gen.Where() can filter obvious shrinks
Given the generator Gen.Int32().Between(0, 100).Where(x => x % 2 == 0)
If it generates the value 14 - it will normally have the shrinks [0, 7, 11, 13]. However, all the shrinks (bar 0), are not even numbers, therefore the shrinks [2, 4, 6, 8, 10, 12] become inaccessible.
Perhaps the secondary shrinks of the discarded ones should be lifted up a level.
Or perhaps a secondary shrink is simply decrementing the value by one until the origin. This might be inefficient, but could uncover unseen cases in a simple way (if there's a shrinking limit in place).