Checks condition, reports a failure at the caller's line and returns whether it held. The
other expect* checks work the same way; jacket test shows the line's source next to the
message.
expect(1 + 1 == 2);
expect(1 + 1 == 2, "the arithmetic is off"); // the message replaces the default one- condition: what must be true.
- message: what to report instead of the default.
- loc: where the check is written, shown when it fails. Leave the default.
expect :: (condition: bool, message := "", loc := #caller_location) -> bool
Checks condition, reports a failure at the caller's line and returns whether it held. The
other expect* checks work the same way; jacket test shows the line's source next to the
message.
Parameters
- condition: bool
- what must be true.
- message := ""
- what to report instead of the default.
- loc := #caller_location
- where the check is written, shown when it fails. Leave the default.
Returns
- bool
expect(1 + 1 == 2);
expect(1 + 1 == 2, "the arithmetic is off"); // the message replaces the default one