Fork me on GitHub

I have zipper data structure using the techniques described in but I’m finding it hard to write a spec that validates child nodes using the protocol. I can’t use a map key because different impls of TreeNode (Zippable in my case) may use different keys. I’ll paste an e.g. next....


Any suggestions would be much appreciated


Is there an easy way to figure out which spec in a large nested spec that is causing "ExceptionInfo Couldn't satisfy such-that predicate after 100 tries." when using (s/exercise ...)?


not afaik but i’m not an expert


usually it’s down to a string or something that has lots of constraints put on it and is difficult to generate reliably, but you probably already know about that; one gotcha that i don’t think is as well-known is that if you have a coll-of that’s got a :kind set? but doesn’t have an into #{}, that can cause the same couldn’t-satisfy-after-100-tries behavior


might not be your issue, but i always feel compelled to mention it when people have this problem because it happened to me and took me a while to figure out


Ah, good tip on the set thing, I haven't run into that yet, but I could see making that mistake.


It doesn't really help you but I highly recommend trying to s/exercise each spec as you write it and build up complex specs in terms of other specs (not just predicates).


Predicates tend to be opaque when you combine them into specs. If you define specs for those predicates, when you combine the specs, you get better error reporting.