examplesWithoutValidation property

  1. @override
Iterable<Uint8List> examplesWithoutValidation
override

Interesting examples of instances (may be valid or invalid).

Use examples to get valid examples.

Use examplesThatAreInvalid to get invalid examples.

Implementation

@override
Iterable<Uint8List> get examplesWithoutValidation {
  final minLength = length?.min ?? 0;
  final maxLength = length?.max ?? 0;
  final lengths = <int>{
    minLength - 1,
    minLength,
    minLength + 1,
    maxLength - 1,
    maxLength,
    maxLength + 1,
  }.toSet().where((element) => element >= 2);
  return [
    Uint8List(0),
    Uint8List.fromList([0]),
    Uint8List.fromList([255]),
    for (var length in lengths) Uint8List(length),
  ];
}