assume method

void assume(
  1. bool condition
)

Abandons this test case unless condition holds.

The case becomes invalid rather than failing: it does not count toward the number of cases the property is asked for, and the engine steers away from generating more like it. Rejecting a large share of cases is itself worth knowing about, which is what the engine's FilterTooMuch health check is for.

Implementation

void assume(bool condition) {
  if (!condition) throw const AssumptionFailed();
}