assertSame

Asserts that the values are the same.

void
assertSame
(
T
U
)
(,,
lazy string msg = null
,
string file = __FILE__
,
size_t line = __LINE__
)

Throws

AssertException otherwise

Examples

Object foo = new Object();
Object bar = new Object();

assertSame(foo, foo);

auto exception = expectThrows!AssertException(assertSame(foo, bar));

assertEquals("expected same: <object.Object> was not: <object.Object>", exception.msg);

Meta