Class AssertPanicExpressionOrError

All Implemented Interfaces:
Consumer<EK9Parser.AssertPanicExpressionContext>

final class AssertPanicExpressionOrError extends TypedSymbolAccess implements Consumer<EK9Parser.AssertPanicExpressionContext>
Validates assertPanic expression - the test-only counterpart to assertThrows that traps an org.ek9.lang::Panic.

Two differences from AssertThrowsExpressionOrError:

  • There is no type argument - Panic is a single fixed type - so there is no TYPE_MUST_EXTEND_EXCEPTION check (that gate is exactly what keeps a plain assertThrows(Panic, ...) from compiling; assertPanic is the sanctioned door).
  • The expression-form result type is fixed to org.ek9.lang::Panic so p <- assertPanic(...) types p as Panic (exposing message()/exitCode()).

Like the other assert-family constructs it is dev-source only; using it in production (non-dev) source is TEST_CONSTRUCT_IN_NON_DEV_SOURCE.