mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 13:52:17 +02:00
Updated regression tests with more non-marking parenthesis examples
[SVN r12912]
This commit is contained in:
@ -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 $`:
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user