blob: bd13ada381c2aaf462ded47b23b0c7a3f1c265ff [file] [log] [blame]
Tristan Matthews04616462013-11-14 16:09:34 -05001The perltest program
2--------------------
3
4The perltest.pl script tests Perl's regular expressions; it has the same
5specification as pcretest, and so can be given identical input, except that
6input patterns can be followed only by Perl's lower case modifiers and certain
7other pcretest modifiers that are either handled or ignored:
8
9 /+ recognized and handled by perltest
10 /++ the second + is ignored
11 /8 recognized and handled by perltest
12 /J ignored
13 /K ignored
14 /W ignored
15 /S ignored
16 /SS ignored
17
18The data lines are processed as Perl double-quoted strings, so if they contain
19" $ or @ characters, these have to be escaped. For this reason, all such
20characters in testinput1, testinput4, testinput6, and testinput11 are escaped
21so that they can be used for perltest as well as for pcretest. The pcretest \Y
22escape in data lines is removed.
23
24The special upper case pattern modifiers such as /A that pcretest recognizes,
25and its special data line escapes, are not used in these files. The output
26should be identical, apart from the initial identifying banner.
27
28The perltest.pl script can also test UTF-8 features. It recognizes the special
29modifier /8 that pcretest uses to invoke UTF-8 functionality. The testinput4
30and testinput6 files can be fed to perltest to run compatible UTF-8 tests.
31However, it is necessary to add "use utf8;" to the script to make this work
32correctly.
33
34The testinput11 file contains tests that use features of Perl 5.10, so does not
35work with Perl 5.8.
36
37The other testinput files are not suitable for feeding to perltest.pl, since
38they make use of the special upper case modifiers and escapes that pcretest
39uses to test some features of PCRE. Some of these files also contains malformed
40regular expressions, in order to check that PCRE diagnoses them correctly.
41
42Philip Hazel
43August 2011