Class IsWithinTestProgram

java.lang.Object
org.ek9lang.compiler.common.IsWithinTestProgram
All Implemented Interfaces:
Predicate<ISymbol>

public final class IsWithinTestProgram extends Object implements Predicate<ISymbol>
Whether this symbol is a test program or a method declared inside one (IsTestProgram has the encoding contract). Hold an instance.

The wider question, for callers walking arbitrary callables rather than programs. Phase 1 puts the marker on the program aggregate and not on its synthetic _main, so a caller looking at methods must climb one scope or it will conclude that no test exists anywhere.

  • Constructor Details

    • IsWithinTestProgram

      public IsWithinTestProgram()
  • Method Details

    • test

      public boolean test(ISymbol symbol)
      Is the symbol, or its enclosing aggregate, a test program.
      Specified by:
      test in interface Predicate<ISymbol>
      Parameters:
      symbol - any symbol, or null
      Returns:
      true when the symbol, or its enclosing aggregate, carries the test marker