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

1 Object foo = new Object();
2 Object bar = new Object();
3 
4 assertSame(foo, foo);
5 
6 auto exception = expectThrows!AssertException(assertSame(foo, bar));
7 
8 assertEquals("expected same: <object.Object> was not: <object.Object>", exception.msg);

Meta