assertTrue

Asserts that a condition is true.

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

Throws

AssertException otherwise

Examples

assertTrue(true);
assertTrue("foo" in ["foo" : "bar"]);

auto exception = expectThrows!AssertException(assertTrue(false));

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

Meta