Updated regression tests with more non-marking parenthesis examples

[SVN r12912]
This commit is contained in:
John Maddock
2002-02-23 12:58:45 +00:00
parent 7f6be58d92
commit e18c474222
2 changed files with 18 additions and 0 deletions

View File

@ -453,6 +453,7 @@ __cdecl
hl_grep_test_proc(const RegEx& e)
{
int start, end;
start = e.Position(0);
end = start + e.Length();
if((matches[hl_match_id] != start) || (matches[hl_match_id + 1] != end))
@ -460,6 +461,19 @@ hl_grep_test_proc(const RegEx& e)
begin_error();
cout << "class RegEx grep match error: found [" << start << "," << end << "] expected [" << matches[hl_match_id] << "," << matches[hl_match_id+1] << "]" << endl;
}
if(0 == (flags[4] & REG_GREP))
{
for(unsigned int sub = 1; sub < e.Marks(); ++sub)
{
start = e.Position(sub);
end = start + e.Length(sub);
if((matches[2*sub] != start) || (matches[2*sub + 1] != end))
{
begin_error();
cout << "class RegEx grep match error: found in sub " << sub << " [" << start << "," << end << "] expected [" << matches[2*sub] << "," << matches[2*sub+1] << "]" << endl;
}
}
}
//
// check $`:

View File

@ -861,6 +861,9 @@ abc|\w+? abcd 0 3
(?:(a+)b+) xaaabbba 1 7 1 4
(?:a+(b+)) xaaabbba 1 7 4 7
a+(?#b+)b+ xaaabbba 1 7
(a)(?:b|$) ab 0 2 0 1
(a)(?:b|$) a 0 1 0 1
;
; try some partial matches:
@ -900,3 +903,4 @@ a+(?#b+)b+ xaaabbba 1 7
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$ ABCD3 -1 -1