regex test: do not assert that system PCRE allows "(?P<1>)"

Perl >= 5.18, and PCRE >= 8.34, disallow this.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325
Reviewed-by: Christian Persch <chpe@gnome.org>
This commit is contained in:
Simon McVittie 2014-07-20 19:34:54 +01:00
parent 1fdece4f22
commit 4e29e9a079

View File

@ -2628,8 +2628,11 @@ main (int argc, char *argv[])
TEST_EXPAND("a", "a", "\\0130", FALSE, "X"); TEST_EXPAND("a", "a", "\\0130", FALSE, "X");
TEST_EXPAND("a", "a", "\\\\\\0", FALSE, "\\a"); TEST_EXPAND("a", "a", "\\\\\\0", FALSE, "\\a");
TEST_EXPAND("a(?P<G>.)c", "xabcy", "X\\g<G>X", FALSE, "XbX"); TEST_EXPAND("a(?P<G>.)c", "xabcy", "X\\g<G>X", FALSE, "XbX");
#ifndef USE_SYSTEM_PCRE
/* PCRE >= 8.34 no longer allows this usage. */
TEST_EXPAND("(.)(?P<1>.)", "ab", "\\1", FALSE, "a"); TEST_EXPAND("(.)(?P<1>.)", "ab", "\\1", FALSE, "a");
TEST_EXPAND("(.)(?P<1>.)", "ab", "\\g<1>", FALSE, "a"); TEST_EXPAND("(.)(?P<1>.)", "ab", "\\g<1>", FALSE, "a");
#endif
TEST_EXPAND(".", EURO, "\\0", FALSE, EURO); TEST_EXPAND(".", EURO, "\\0", FALSE, EURO);
TEST_EXPAND("(.)", EURO, "\\1", FALSE, EURO); TEST_EXPAND("(.)", EURO, "\\1", FALSE, EURO);
TEST_EXPAND("(?P<G>.)", EURO, "\\g<G>", FALSE, EURO); TEST_EXPAND("(?P<G>.)", EURO, "\\g<G>", FALSE, EURO);