assertMultilineOpEquals

Asserts that two multiline strings are equal, with a more detailed error message than the default assert.

version(unittest)
pure @safe
void
assertMultilineOpEquals
(
const(char[]) actual
,
const(char[]) expected
,
const string file = __FILE__
,
const uint line = __LINE__
)

Parameters

actual const(char[])

Actual string.

expected const(char[])

Expected string.

Examples

    enum actual =
"abc
def
ghi";

    enum expected =
"abc
deF
ghi";

    assertMultilineOpEquals(actual, expected);

/+
core.exception.AssertError@file.d(123):
Line mismatch at file.d:456, block 2:3; expected 'F'(70) was 'f'(102)
expected:"deF"
  actual:"def"
            ^
 +/