Skip to content

assert::empty(string) template function #14

@olegsych

Description

@olegsych

A semantic assertion to replace low-level assertions for C++ strings:

std::string s;
Assert::AreEqual<size_t>(0, s.length());

and C strings:

char* s;
Assert::AreEqual<size_t>(0, strlen(s));

with clean, high-level

assert::empty(s);

which includes actual content of the string in the failure message in addition to the string length.

The new method should be defined in assert/string.h and handle the generic C++ string classes and both char* and wchar_t* C++ strings, similar to the existing assert::find method.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions