mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Enhancement - caseless find
- Added support for a starting offset.
This commit is contained in:
parent
2dfe144236
commit
06ecef76d3
3 changed files with 52 additions and 1 deletions
|
@ -34,7 +34,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (176);
|
||||
UnitTest t (178);
|
||||
|
||||
// void wrapText (std::vector <std::string>& lines, const std::string& text, const int width)
|
||||
std::string text = "This is a test of the line wrapping code.";
|
||||
|
@ -356,6 +356,9 @@ int main (int argc, char** argv)
|
|||
t.is ((int) find ("FOO", "fo", false), 0, "FOO contains fo (caseless)");
|
||||
t.is ((int) find ("FOO", "FO", false), 0, "FOO contains FO (caseless)");
|
||||
|
||||
// Test start offset.
|
||||
t.is ((int) find ("one two three", "e", 3, true), (int) 11, "offset obeyed");
|
||||
t.is ((int) find ("one two three", "e", 11, true), (int) 11, "offset obeyed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue