shrink method

  1. @override
Iterable<Shrinkable<T>> shrink()
override

Generates an Iterable of Shrinkables that fulfill the following criteria:

  • They are similar to this: They only differ in little ways.
  • They are simpler than this: The transitive hull is finite acyclic. If you would call shrink on all returned values and on the values returned by them etc., this process should terminate sometime.

Implementation

@override
Iterable<Shrinkable<T>> shrink() sync* {
  for (var i = 0; i < fields.length; i++) {
    for (final shrunk in fields[i].shrink()) {
      yield ShrinkableCombination(List.of(fields)..[i] = shrunk, combiner);
    }
  }
}