Testing module

expect_not_null

procedureextensionsince 0.28.0Source

Checks that pointer is not null.

Example
x := 1;
expect_not_null(*x);
expect_not_null :: (pointer: *$T, loc := #caller_location) -> bool

Checks that pointer is not null.

Parameters

pointer: *$T
the pointer that must not be null.
loc := #caller_location
where the check is written, shown when it fails. Leave the default.

Returns

bool
Example
x := 1;
expect_not_null(*x);

See also