Tests whether a string ends with a given literal.
More...
Tests whether a string ends with a given literal.
- Example:
assert( ends.test("foobaz"));
assert( ends.test("baz"));
assert(!ends.test("foo"));
EndsWithTest(std::string literal) noexcept
Constructs an EndsWithTest that succeeds for subjects that end with the given literal.
Definition at line 41 of file EndsWithTest.h.
◆ EndsWithTest()
hext::EndsWithTest::EndsWithTest |
( |
std::string |
literal | ) |
|
|
explicitnoexcept |
Constructs an EndsWithTest that succeeds for subjects that end with the given literal.
- Parameters
-
literal | A string that a subject must end with. |
◆ test()
bool hext::EndsWithTest::test |
( |
const char * |
subject | ) |
const |
|
overridevirtual |
Returns true if subject ends with 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: