final protected async function writeSummaryAsync()

in src/_Private/CLIOutputHandler.hack [102:116]


  final protected async function writeSummaryAsync(
    <<__AcceptDisposable>> IO\WriteHandle $handle,
  ): Awaitable<void> {
    $result_counts = $this->getResultCounts();
    $num_tests = Math\sum($result_counts);

    await $handle->writeAllAsync(Str\format(
      "\n\nSummary: %d test(s), %d passed, %d failed, %d skipped, %d error(s).\n",
      $num_tests,
      $result_counts[HackTest\TestResult::PASSED] ?? 0,
      $result_counts[HackTest\TestResult::FAILED] ?? 0,
      $result_counts[HackTest\TestResult::SKIPPED] ?? 0,
      $result_counts[HackTest\TestResult::ERROR] ?? 0,
    ));
  }