Add test for bug already fixed by the refactoring.

This commit is contained in:
Philip.Hazel 2016-10-13 16:08:08 +00:00
parent bf6f0bb335
commit bc3e331efd
3 changed files with 34 additions and 0 deletions

View File

@ -27,6 +27,8 @@ some minor bugs and Perl incompatibilities were fixed, including:
the name "DEFINE" exists. PCRE2 now does likewise.
(d) A recursion condition test such as (?(R2)...) must now refer to an
existing subpattern.
(e) A conditional recursion test such as (?(R)...) misbehaved if there was a
group whose name began with "R".
One effect of the refactoring is that some error numbers and messages have
changed, and the pattern offset given for compiling errors is not always the

4
testdata/testinput2 vendored
View File

@ -4888,4 +4888,8 @@ a)"xI
/[a-\d]+/
a-a9-a
/(?<RA>abc)(?(R)xyz)/B
/(?<R>abc)(?(R)xyz)/B
# End of testinput2

28
testdata/testoutput2 vendored
View File

@ -15306,6 +15306,34 @@ Failed: error 150 at offset 4: invalid range in character class
Failed: error 150 at offset 5: invalid range in character class
a-a9-a
/(?<RA>abc)(?(R)xyz)/B
------------------------------------------------------------------
Bra
CBra 1
abc
Ket
Cond
Cond recurse any
xyz
Ket
Ket
End
------------------------------------------------------------------
/(?<R>abc)(?(R)xyz)/B
------------------------------------------------------------------
Bra
CBra 1
abc
Ket
Cond
1 Cond ref
xyz
Ket
Ket
End
------------------------------------------------------------------
# End of testinput2
Error -63: PCRE2_ERROR_BADDATA (unknown error number)
Error -62: bad serialized data