assertNull

Asserts that the value is null.

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

Throws

AssertException otherwise

Examples

1 Object foo = new Object();
2 
3 assertNull(null);
4 
5 auto exception = expectThrows!AssertException(assertNull(foo));
6 
7 assertEquals("Assertion failure", exception.msg);

Meta