Hello everybody,
I love ScalaCheck, and I would love it even more if I could just get this one conceptual problem solve.
So I have a collection of items, and I want to generate things that are associated to each and every one item in the collection.
The best I can do, right now, is Gen.zip(Gen.oneOf(collection), ... ) and add a suchThat clause later down to check that all entries in the condition are present.
For instance, this might be Gen.mapOf(Gen.zip(Gen.oneOf(collection), ....)).suchThat{map => map.keySet == collection.toSet}
But that doesn't work, as I get lots of evaluations thrown out.
So how can I do it???