Class HumanTestFormatter

java.lang.Object
org.ek9lang.cli.HumanTestFormatter
All Implemented Interfaces:
TestResultFormatter

final class HumanTestFormatter extends Object implements TestResultFormatter
Human-readable test output formatter (-t or -t1). Provides visual formatting with colors, icons, test type indicators, and clear structure. Uses TerminalColors for terminal capability detection and graceful fallback.

Discovery output (with colors/emoji):

Found 6 tests:
  2 assert (unit tests with assertions)
  1 blackbox (output validated against expected_output.txt)
  3 parameterized (6 cases total)

Group "database": 2 tests (sequential execution)

Results output (with colors/emoji):

✅ PASS module::SimpleTest [Assert] (3ms)
✅ PASS module::OutputTest [BlackBox] (2ms)
✅ PASS module::ParamTest [Param:hello] (4ms)
❌ FAIL module::ParamTest [Param:edge] (1ms)
    Output mismatch (case: edge)

Summary: 3 passed, 1 failed (4 results from 3 programs)
Types: 1 assert, 1 blackbox, 2 parameterized
Duration: 10ms
  • Constructor Details

    • HumanTestFormatter

      HumanTestFormatter(boolean verbose)
  • Method Details

    • reportDiscovery

      public void reportDiscovery(List<DiscoveredTest> tests, PrintStream out)
      Description copied from interface: TestResultFormatter
      Report the discovery of tests before execution begins.

      The discovery report should include:

      • Test type breakdown (assert-based vs blackbox vs parameterized)
      • Total test case count (including parameterized cases)
      • Group information if applicable
      Specified by:
      reportDiscovery in interface TestResultFormatter
      Parameters:
      tests - The discovered tests with metadata
      out - The output stream
    • reportExecutionStart

      public void reportExecutionStart(int testCount, PrintStream out)
      Description copied from interface: TestResultFormatter
      Report that test execution is starting. Some formatters may output a progress message here.
      Specified by:
      reportExecutionStart in interface TestResultFormatter
      Parameters:
      testCount - The number of tests to execute
      out - The output stream
    • reportResults

      public void reportResults(List<TestResult> results, PrintStream out)
      Description copied from interface: TestResultFormatter
      Report all test results after execution completes.
      Specified by:
      reportResults in interface TestResultFormatter
      Parameters:
      results - The test results
      out - The output stream