string: add stub 'contains' query
This commit is contained in:
parent
5025f832ca
commit
2ce92cb2c8
@ -127,6 +127,11 @@ namespace cruft {
|
||||
) + 1u;
|
||||
}
|
||||
|
||||
bool contains (std::string_view key) const noexcept
|
||||
{
|
||||
return std::find (begin (), end (), key) != end ();
|
||||
}
|
||||
|
||||
private:
|
||||
const range_type m_range;
|
||||
const value_type m_separator;
|
||||
|
@ -69,6 +69,20 @@ test_tokeniser (cruft::TAP::logger &tap)
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void
|
||||
test_contains (cruft::TAP::logger &tap)
|
||||
{
|
||||
struct {
|
||||
char const *haystack;
|
||||
char const *needle;
|
||||
bool expected;
|
||||
char const *message;
|
||||
} const TESTS[] = {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
int
|
||||
main (int, char**)
|
||||
@ -77,6 +91,7 @@ main (int, char**)
|
||||
|
||||
test_tokeniser (tap);
|
||||
test_position (tap);
|
||||
test_contains (tap);
|
||||
|
||||
return tap.status ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user