mergedOutcomes function

List<PluginCheckOutcome> mergedOutcomes(
  1. String plugin,
  2. List<PluginCheckOutcome> ran, {
  3. required bool isOurs(
    1. PluginCheckOutcome outcome
    ),
})

ran in place of the outcomes of isOurs in the report already in the package, if there is one: what a suite writes, so the plugin suite and the render suite, each in a test file of its own, leave one report holding both, judged by earnsBadge on both.

An entry of the report already there that this build of the suite cannot read (PluginCheckOutcome.fromJson refuses it) is left out, and the report is written anew with what ran.

Implementation

List<PluginCheckOutcome> mergedOutcomes(
  String plugin,
  List<PluginCheckOutcome> ran, {
  required bool Function(PluginCheckOutcome outcome) isOurs,
}) => <PluginCheckOutcome>[
  for (final json in readConformanceReportOutcomes(plugin))
    if (_readOutcome(json) case final kept? when !isOurs(kept)) kept,
  ...ran,
];