2
2
of PCRE's API, error diagnostics, and the compiled code of some patterns.
3
3
It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4
4
Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5
either because PCRE can't be compatible, or there is potential Perl
5
either because PCRE can't be compatible, or there is a possible Perl
8
/-- Originally, the Perl 5.10 things were in here too, but now I have separated
9
many (most?) of them out into test 11. However, there may still be some
10
that were overlooked. --/
8
/-- Originally, the Perl 5.10 and 5.11 things were in here too, but now I have
9
separated many (most?) of them out into test 11. However, there may still
10
be some that were overlooked. --/
3233
3241
/(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3249
/--- This should, and does, fail. In Perl, it does not, which I think is a
3250
bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3255
/--- These should be different, but in Perl 5.11 are not, which I think
3256
is a bug in Perl. ---/
3258
/A(*THEN)B|A(*THEN)C/K
3261
/A(*PRUNE)B|A(*PRUNE)C/K
3264
/--- A whole lot of tests of verbs with arguments are here rather than in test
3265
11 because Perl doesn't seem to follow its specification entirely
3268
/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
3269
not clear how Perl defines "involved in the failure of the match". ---/
3271
/^(A(*THEN:A)B|C(*THEN:B)D)/K
3278
/--- Check the use of names for success and failure. PCRE doesn't show these
3279
names for success, though Perl does, contrary to its spec. ---/
3281
/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
3288
/--- An empty name does not pass back an empty string. It is the same as if no
3289
name were given. ---/
3291
/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
3295
/--- PRUNE goes to next bumpalong; COMMIT does not. ---/
3300
/(*MARK:A)(*PRUNE:B)(C|X)/K
3304
/(*MARK:A)(*THEN:B)(C|X)/K
3308
/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
3310
/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
3315
/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
3318
/--- This should fail; the SKIP advances by one, but when we get to AC, the
3319
PRUNE kills it. ---/
3321
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3324
/A(*:A)A+(*SKIP)(B|Z) | AC/xK
3327
/--- This should fail, as a null name is the same as no name ---/
3329
/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
3332
/--- This fails in PCRE, and I think that is in accordance with Perl's
3333
documentation, though in Perl it succeeds. ---/
3335
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
3338
/--- Mark names can be duplicated ---/
3344
/^A(*:A)B|^X(*:A)Y/K
3348
/--- A check on what happens after hitting a mark and them bumping along to
3349
something that does not even start. Perl reports tags after the failures here,
3350
though it does not when the individual letters are made into something
3351
more complicated. ---/
3362
/--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3363
optimizations defeat this. So does the PCRE optimization unless we disable it
3371
/--- Repeat some tests with added studying. ---/
3376
/A(*THEN)B|A(*THEN)C/KS
3379
/A(*PRUNE)B|A(*PRUNE)C/KS
3382
/^(A(*THEN:A)B|C(*THEN:B)D)/KS
3389
/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
3396
/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
3403
/(*MARK:A)(*PRUNE:B)(C|X)/KS
3407
/(*MARK:A)(*THEN:B)(C|X)/KS
3411
/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
3414
/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
3417
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
3420
/A(*:A)A+(*SKIP)(B|Z) | AC/xKS
3423
/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
3426
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
3429
/A(*:A)B|XX(*:B)Y/KS
3443
/^(ab (c+(*THEN)cd) | xyz)/x
3446
/^(ab (c+(*PRUNE)cd) | xyz)/x
3449
/^(ab (c+(*FAIL)cd) | xyz)/x
3452
/--- Perl 5.11 gets some of these wrong ---/
3235
3494
/-- End of testinput2 --/