kaycxx-test
C++ unit test framework
Loading...
Searching...
No Matches
assert_not_contain

Asserts that a string does not contain text or that a range does not contain an element.

String-like values use substring semantics. Other ranges use element lookup through std::ranges::find, so an element must compare equal to the unexpected value to fail.

#include <vector>
#include <kaycxx/test.hpp>
using namespace kaycxx::test;
int main() {
assert_not_contain("hello world", "error");
assert_not_contain("abc", 'x');
auto values = std::vector{1, 2, 3};
assert_not_contain(values, 4);
}
Unit test framework functions and types.
Definition test.hpp:15
Includes the complete public test API.

Null C string pointers do not contain anything and therefore pass assert_not_contain.