Tests whether a string contains a given literal.
More...
Tests whether a string contains a given literal.
- Example:
assert( contains.test("foo"));
assert( contains.test("barfoobar"));
assert(!contains.test("barfo"));
ContainsTest(std::string literal) noexcept
Constructs a ContainsTest that succeeds for subjects that contain the given literal.
Definition at line 41 of file ContainsTest.h.
◆ ContainsTest()
hext::ContainsTest::ContainsTest |
( |
std::string |
literal | ) |
|
|
explicitnoexcept |
Constructs a ContainsTest that succeeds for subjects that contain the given literal.
- Parameters
-
literal | A string that a subject must contain. |
◆ test()
bool hext::ContainsTest::test |
( |
const char * |
subject | ) |
const |
|
overridevirtual |
Return true if subject contains the given literal.
- Parameters
-
subject | The string that is to be tested. |
Implements hext::ValueTest.
The documentation for this class was generated from the following file: