kaycxx-assert
C++ assertion library
Loading...
Searching...
No Matches
assert_equal

Asserts that two values are equal.

For normal values, both arguments must have the same unqualified type and are compared with operator==. C string forms are handled specially so text is compared instead of pointer identity. This allows practical checks like comparing char const* with a string literal.

#include <string>
using namespace kaycxx::assert;
int main() {
assert_equal(40 + 2, 42);
auto name = std::string{"Kay"};
assert_equal(name, "Kay");
}
Includes the complete public assertion API.
Assertion functions and related types.
Definition assert.hpp:15

On failure, the exception message includes rendered actual and expected values.