matchesSelection static method

bool matchesSelection(
  1. EnsembleTestDefinition def,
  2. EnsembleTestSelection selection
)

Implementation

static bool matchesSelection(
  EnsembleTestDefinition def,
  EnsembleTestSelection selection,
) {
  final test = def.testCase;
  final idMatches = selection.ids.isNotEmpty &&
      selection.ids.any(
        (id) =>
            test.id == id ||
            test.id.startsWith('$id[') ||
            id.startsWith('${test.id}['),
      );
  final featureMatches = selection.features.isNotEmpty &&
      selection.features.contains(test.feature);
  final profileMatches = selection.profiles.isNotEmpty &&
      matchesProfileSelection(test, selection);
  final tagMatches = selection.tags.isNotEmpty &&
      test.tags.any((tag) => selection.tags.contains(tag));
  final pathMatches = selection.paths.isNotEmpty &&
      selection.paths.any((path) => def.assetPath.contains(path));
  return idMatches ||
      featureMatches ||
      profileMatches ||
      tagMatches ||
      pathMatches;
}