assertEq

throws AssertError if !eq( a, b )

void
assertEq
(
A
B
string file = __FILE__
size_t line = __LINE__
)
(
in A a
,
in B b
,
lazy string fmt = null
)
if (
is(typeof(eq(a, b)))
)

Parameters

a A

first value

b B

second value

fmt string

error message format, must have two string places '%s' for a and b

Examples

assert(  mustExcept!AssertError({ assertEq( 1, 2 ); }) );
assert(  mustExcept!AssertError({ assertEq( [1,2], [2,3] ); }) );
assert( !mustExcept!AssertError({ assertEq( [1,2], [1,2] ); }) );

Meta