Closed si14 closed 11 years ago
Nice catch. Will try and get a fix in today or tomorrow.
Would you expect :vectorz
to shrink at all, or just shrink to :z
?
I wouldn't expect :vectorz
to shrink at all. My intuition is that gen/elements
should just choose one of alternatives instead of messing with what's inside.
Yeah, this is a tough issue. As far as simple-check is concerned, it just sees the keywords, and uses the shrink protocol to shrink it (dispatching on the keyword type). Need to ponder on this a bit, not sure how the Erlang version does this.
I've got a little bit of a lead on how this might work, going to work on a proof-of-concept and see how much of a breaking change it might be.
I have a proof-of-concept in the generators-shrink-themselves branch. Assuming this continues to look good, it'll get merged in. This should solve all other issues with information implicitly or explicitly encoded in generators not being respected during shrinking.
All tests are passing on this branch now. I'm going to get it cleaned up and then ask for some folks to test it out. It's a big change, but I'm pretty confident it will end up getting merged in.
Awesome! Thank you.
Here is a property:
If obviously fails (
prn
returns nil). However, it's interesting how this is shrinked:This looks wrong to me.