Skip to content

Commit

Permalink
RE test improved
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Jan 30, 2015
1 parent 38be0dd commit e8ffdcf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions far/RegExp.cpp
Expand Up @@ -3988,14 +3988,17 @@ void RegExp::TrimTail(const wchar_t* const start, const wchar_t*& strend) const
void Test()
{
RegExp re;
if (re.Compile(L"/a*?ca/"))
{
RegExpMatch m = { -1, -1 };
intptr_t n = 1;
auto Result = re.Compile(L"/a*?ca/");

int r = re.Search(L"abca", &m, n);
assert(r && n == 1 && m.start == 2 && m.end == 4);
}
assert(Result);

RegExpMatch m = { -1, -1 };
intptr_t n = 1;
Result = re.Search(L"abca", &m, n);

assert(Result);
assert(n == 1);
assert(m.start == 2 && m.end == 4);
}

SELF_TEST(Test());
Expand Down

0 comments on commit e8ffdcf

Please sign in to comment.