Disable QCheck2 shrinker with a parameter
That'd be cool to disable the shrinker with a boolean in Test.make for instance. I don't know if we can already do this or if it's impossible but this might be a really good feature.
It can happen that the test is wrong and since the generated value is really not-trivial, it takes a lot of time to shrink.
On the one hand I'm supportive of this feature.
I've used set_shrink Shrink.nil some_gen in similar situations for "QCheck1" in the past.
One could go for a similar design for QCheck2 where the operation changes/removes the Tree children.
On the other hand, to me this indicates short-comings of the QCheck2 shrinkers. I observed these and commented on them in #157 #163 and https://github.com/c-cube/qcheck/pull/153#issuecomment-900238995 while I was trying to test QCheck2 a bit. We need example cases to reproduce and understand what is going on when shrinking takes too long in order to improve the situation. I understand that carving out those from a bigger project can require quite some effort though.
I think I can extract one example pretty easily. One co-worker wrote a Merkle Tree or something, it shouldn't have too much dependency with our project.
I think I can extract one example pretty easily. One co-worker wrote a Merkle Tree or something, it shouldn't have too much dependency with our project.
Well, you shouldn't trust my words.
Anyway, I feel that we need it even if the generator is not that long. It's very situational but sometimes, no shrinker is the best solution. My dirty solution currently is:
make_primitive
~gen:(fun rand -> generate1 ~rand gen)
~shrink:(fun _ -> Seq.empty)
I'll try to tackle this.