From bc3e331efd60eb2a5f37bd47c3437c44aafed042 Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Thu, 13 Oct 2016 16:08:08 +0000 Subject: [PATCH] Add test for bug already fixed by the refactoring. --- ChangeLog | 2 ++ testdata/testinput2 | 4 ++++ testdata/testoutput2 | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4ddfdd1..62f2436 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/testdata/testinput2 b/testdata/testinput2 index dd9faff..4120643 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -4888,4 +4888,8 @@ a)"xI /[a-\d]+/ a-a9-a +/(?abc)(?(R)xyz)/B + +/(?abc)(?(R)xyz)/B + # End of testinput2 diff --git a/testdata/testoutput2 b/testdata/testoutput2 index ce8a30e..ff30167 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -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 +/(?abc)(?(R)xyz)/B +------------------------------------------------------------------ + Bra + CBra 1 + abc + Ket + Cond + Cond recurse any + xyz + Ket + Ket + End +------------------------------------------------------------------ + +/(?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