Testing module

assume

procedureextensionsince 0.30.0Source

Checks the arguments of a property: skips the trial, without failing it, when condition does not hold. A property that returns a value writes if !condition return true;.

Example
run_property(t, (divisor: s64) {
    assume(divisor != 0);
    expect_equal(10 / divisor * divisor + 10 % divisor, 10);
});
assume :: (condition: bool)

Checks the arguments of a property: skips the trial, without failing it, when condition does not hold. A property that returns a value writes if !condition return true;.

Parameters

condition: bool
the trial is skipped when this is false.
Example
run_property(t, (divisor: s64) {
    assume(divisor != 0);
    expect_equal(10 / divisor * divisor + 10 % divisor, 10);
});

See also