assertOp

Asserts that the condition (lhs op rhs) is satisfied.

template assertOp(string op)
void
assertOp
(
T
U
)
(
T lhs
,
U rhs
,
lazy string msg = null
,
string file = __FILE__
,
size_t line = __LINE__
)

Members

Functions

assertOp
void assertOp(T lhs, U rhs, string msg, string file, size_t line)
Undocumented in source. Be warned that the author may not have intended to support it.

Throws

AssertException otherwise

Examples

assertLessThan(2, 3);

auto exception = expectThrows!AssertException(assertGreaterThanOrEqual(2, 3));

assertEquals("condition (2 >= 3) not satisfied", exception.msg);
assertIn("foo", ["foo" : "bar"]);

auto exception = expectThrows!AssertException(assertNotIn("foo", ["foo" : "bar"]));

assertEquals(`condition ("foo" !in ["foo":"bar"]) not satisfied`, exception.msg);

See Also

Meta