Tests whether a string begins with a given literal.
More...
Tests whether a string begins with a given literal.
- Example:
assert( begins.test("Startles your sleeping ears to hear"));
assert(!begins.test("startles your sleeping ears to hear"));
assert(!begins.test(""));
BeginsWithTest(std::string literal) noexcept
Constructs a BeginsWithTest that succeeds for subjects that begin with the given literal.
Definition at line 41 of file BeginsWithTest.h.
◆ BeginsWithTest()
hext::BeginsWithTest::BeginsWithTest |
( |
std::string |
literal | ) |
|
|
explicitnoexcept |
Constructs a BeginsWithTest that succeeds for subjects that begin with the given literal.
- Parameters
-
literal | A string that a subject must begin with. |
◆ test()
bool hext::BeginsWithTest::test |
( |
const char * |
subject | ) |
const |
|
overridevirtual |
Return true if subject begins 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: