fsharp-hedgehog icon indicating copy to clipboard operation
fsharp-hedgehog copied to clipboard

Obtain shrink tree from a generator for particular value

Open TysonMN opened this issue 4 years ago • 1 comments

Given our current implementation, is it possible to define a function with signature

'a -> Gen<'a> -> Tree<'a>

that returns the shrink tree that the generator would use if the given value failed the test?

Of course this is not always possible. For example, the given value might not be in the range of the generator.

TysonMN avatar Feb 23 '21 04:02 TysonMN

I think being able to inspect a shrink tree might be useful, in case Hedgehog does something unexpected when creating shrinks. I don't see any drawbacks to this, so :+1:

ghost avatar Mar 21 '21 19:03 ghost