Fork me on GitHub

is it possible to have a generator that doesn’t shrink at one level, but its children do shrink? For example:

(commit-to (gen/one-of [gen-for-case-1 gen-for-case-2]))
So once it chooses either case 1 or 2 it won’t try the other, but will shrink the things gen’d in them?


Not using public functionality, I don't think


A hacky idea is to have a predicate on the generated values to tell you what branch matched, and then wrap that in a such-that that insists it is something from that branch


Super goofy looking, and wastes a bit of cpu, but otherwise would do what you're describing


Having a hard time imagining what that would look like, but I think if it’s not standard I can just duplicate my test 😅


Yeah I couldn't tell what your appetite for Weird was 🙂

😂 3