verifyAllCombinations<T> static method

void verifyAllCombinations<T>(
  1. List<List<T>> inputs, {
  2. required String processor(
    1. Iterable<List<T>> combination
    ),
  3. Options options = const Options(),
})

Verifies all combinations of inputs for a provided function.

Implementation

static void verifyAllCombinations<T>(
  List<List<T>> inputs, {
  required String Function(Iterable<List<T>> combination) processor,
  Options options = const Options(),
}) {
  // Generate all combinations of inputs
  final combinations = ApprovalUtils.cartesianProduct(inputs);

  // Iterate over each combination, apply the processor function, and verify the result

  try {
    // Process the combination to get the response
    final response = processor(combinations);

    // Verify the processed response
    verify(response, options: options);
  } catch (_) {
    rethrow;
  }
}