Skip to content
Permalink
Browse files

RE test improved

  • Loading branch information...
alabuzhev committed Jan 30, 2015
1 parent 38be0dd commit e8ffdcf07e78ea0c5debceec68d4875e0e4b2c5a
Showing with 10 additions and 7 deletions.
  1. +10 −7 far/RegExp.cpp
@@ -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());

0 comments on commit e8ffdcf

Please sign in to comment.
You can’t perform that action at this time.