assertNull

Asserts that the value is null.

@safe pure
void
assertNull
(
T
)
(,
lazy string msg = null
,
string file = __FILE__
,
size_t line = __LINE__
)

Throws

AssertException otherwise

Examples

Object foo = new Object();

assertNull(null);

auto exception = expectThrows!AssertException(assertNull(foo));

assertEquals("Assertion failure", exception.msg);

Meta