assertOp

Useful template to generate an assert check function

template assertOp(string op)
void
assertOp
(
T1
T2
)
(
T1 lhs
,
T2 rhs
,
string file = __FILE__
,
size_t line = __LINE__
)

Members

Functions

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

Examples

alias assertEqual = assertOp!"==";
alias assertNotEqual = assertOp!"!=";
alias assertGreaterThan = assertOp!">";
alias assertGreaterThanOrEqual = assertOp!">=";

assertEqual(1, 1);
assertNotEqual(1, 2);
assertGreaterThan(2, 1);
assertGreaterThanOrEqual(2, 2);

Meta