Open vlsi opened 5 years ago
@visi Thanks for this. If doable, sounds like a nice addition.
@visi I'm looking into an implementation for this issue.
Suppose the target type is:
class Foo {
int a;
String b;
boolean c;
}
If asked to shrink a particular instance f
of Foo
, Fields.shrink()
could ask each field generator for smaller values for each of f.a
, f.b
, and f.c
; so it would have lists of each of these.
What should the list of shrinks of f
be?
Foo
s as the minimum length of the lists of shrunken field values?Foo
s as the size of the Cartesian products of the field shrink lists?That is why https://github.com/pholser/junit-quickcheck/issues/220 is important.
If you are OK to read Apache 2.0 code, then please check https://github.com/gradle/gradle/pull/10724/files#diff-24a277fc1a43b679d84443863b0cb58aR82-R88
It looks like
@Fields
does not support shrinking.Use case:
It does not seem try shrinking the values :(