Testing module

require_equal

procedureextensionsince 0.28.0Source

expect_equal, then returns from the calling procedure on a failure.

Example↗
require_equal(1 + 1, 2);
require_equal :: (got: $T, want: $U, loc := #caller_location)

expect_equal, then returns from the calling procedure on a failure.

Parameters

got: $T
the value under test.
want: $U
the value it must equal.
loc := #caller_location
where the check is written, shown when it fails. Leave the default.
Example↗
require_equal(1 + 1, 2);

See also