Class ExpectedOutputCompanions

java.lang.Object
org.ek9lang.compiler.phase5.callgraph.ExpectedOutputCompanions
All Implemented Interfaces:
Predicate<String>

public final class ExpectedOutputCompanions extends Object implements Predicate<String>
THE check for whether a @Test program carries expected-output companion files — the validation mechanism EK9 accepts INSTEAD of assertions. Hold one and ask it; do not re-derive the lookup.

Two consumers need the same answer for different reasons and must not drift apart: EmptyTestDetector asks it to decide whether a test is empty (E81007 fires only when there are neither assertions NOR expected-output files), and the input-variety reporting asks it to explain an asserted figure. A test validated purely by expected output records DRIVEN cells and zero ASSERTED ones, because the variety runtime opens its assert window around an assert condition and nothing else — so without knowing how a suite validates, a reader cannot tell thin testing from a blind spot in the instrument.

The source name arrives as a file:// URI (a token's "general identifier"). Stripping the scheme is load-bearing: Path.of otherwise treats file: as a path segment, the parent directory is garbage, the sibling files are never found, and a valid assert-free test looks empty — a false E81007.

  • Constructor Details

    • ExpectedOutputCompanions

      public ExpectedOutputCompanions()
  • Method Details

    • test

      public boolean test(String sourceFile)
      Whether expected-output companions sit beside the given source.
      Specified by:
      test in interface Predicate<String>
      Parameters:
      sourceFile - the test's source file, as a path or a file:// URI; may be null
      Returns:
      true when expected_output.txt or any expected_case_*.txt is present