assertEquals

Asserts that the string values are equal.

  1. void assertEquals(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)
    void
    assertEquals
    (
    T
    U
    )
    (
    ,,
    lazy string msg = null
    ,
    string file = __FILE__
    ,
    size_t line = __LINE__
    )
    if (
    isSomeString!T
    )
  2. void assertEquals(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)
  3. void assertEquals(T expected, U actual, lazy string msg = null, string file = __FILE__, size_t line = __LINE__)

Throws

AssertException otherwise

Examples

1 assertEquals("foo", "foo");
2 
3 auto exception = expectThrows!AssertException(assertEquals("bar", "baz"));
4 
5 assertEquals("expected: <ba<r>> but was: <ba<z>>", exception.msg);

Meta