assertEmpty

Asserts that the value is empty.

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

Throws

AssertException otherwise

Examples

assertEmpty([]);

auto exception = expectThrows!AssertException(assertEmpty([1, 2, 3]));

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

Meta