assertEndsWith

Assert that a string ends with a particular string.

void
assertEndsWith
(
string value
,
string suffix
,
string message = "Failed asserting ends with"
,
string file = __FILE__
,
size_t line = __LINE__
)

Parameters

value string

The value used during the assertion.

suffix string

The suffix to match.

message string

The error message to display.

file string

The file name where the error occurred. The value is added automatically at the call site.

line size_t

The line where the error occurred. The value is added automatically at the call site.

Throws

DUnitAssertError if the assertation fails.

Examples

"foo bar".assertEndsWith("bar");
"baz qux".assertEndsWith("qux");

// Assert a DUnitAssertError is thrown if assertEndsWith fails.
"foo".assertEndsWith("bar").assertThrow!(DUnitAssertError)("Failed asserting ends with");

Meta