assertEquals

Asserts that the string values are equal.

  1. void assertEquals(T expected, U actual, string msg, string file, size_t line)
    @safe pure
    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, string msg, string file, size_t line)
  3. void assertEquals(T expected, U actual, string msg, string file, size_t line)

Throws

AssertException otherwise

Examples

assertEquals("foo", "foo");

auto exception = expectThrows!AssertException(assertEquals("bar", "baz"));

assertEquals("expected: <ba<r>> but was: <ba<z>>", exception.msg);

Meta