missing file in change#5170
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / regcomp
1   regcomp.c     AOK
2
3   Strange *+?{} on zero-length expression       [S_study_chunk]
4         /(?=a)?/
5
6   %.*s matches null string many times           [S_regpiece]
7         $a = "ABC123" ; $a =~ /(?=a)*/'
8
9   /%.127s/: Unrecognized escape \\%c passed through"    [S_regatom] 
10         $x = '\m' ; /$x/
11
12   Character class syntax [. .] is reserved for future extensions [S_regpposixcc]
13
14   Character class syntax [= =] is reserved for future extensions [S_checkposixcc]
15
16   Character class syntax [%c %c] belongs inside character classes [S_checkposixcc] 
17   
18   /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
19
20   /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
21
22   /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass] 
23
24   /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8] 
25
26 __END__
27 # regcomp.c [S_regpiece]
28 use warnings 'regexp' ;
29 my $a = "ABC123" ; 
30 $a =~ /(?=a)*/ ;
31 no warnings 'regexp' ;
32 $a =~ /(?=a)*/ ;
33 EXPECT
34 (?=a)* matches null string many times at - line 4.
35 ########
36 # regcomp.c [S_study_chunk]
37 use warnings 'regexp' ;
38 $_ = "" ;
39 /(?=a)?/;
40 no warnings 'regexp' ;
41 /(?=a)?/;
42 EXPECT
43 Strange *+?{} on zero-length expression at - line 4.
44 ########
45 # regcomp.c [S_regatom]
46 $x = '\m' ;
47 use warnings 'regexp' ;
48 $a =~ /a$x/ ;
49 no warnings 'regexp' ;
50 $a =~ /a$x/ ;
51 EXPECT
52 /a\m/: Unrecognized escape \m passed through at - line 4.
53 ########
54 # regcomp.c [S_regpposixcc S_checkposixcc]
55 use warnings 'regexp' ;
56 $_ = "" ;
57 /[:alpha:]/;
58 /[.bar.]/;
59 /[=zog=]/;
60 /[[:alpha:]]/;
61 /[[.foo.]]/;
62 /[[=bar=]]/;
63 /[:zog:]/;
64 no warnings 'regexp' ;
65 /[:alpha:]/;
66 /[.foo.]/;
67 /[=bar=]/;
68 /[[:alpha:]]/;
69 /[[.foo.]]/;
70 /[[=bar=]]/;
71 /[:zog:]/;
72 BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 }
73 /[[:zog:]]/;
74 EXPECT
75 Character class syntax [: :] belongs inside character classes at - line 4.
76 Character class syntax [. .] belongs inside character classes at - line 5.
77 Character class syntax [. .] is reserved for future extensions at - line 5.
78 Character class syntax [= =] belongs inside character classes at - line 6.
79 Character class syntax [= =] is reserved for future extensions at - line 6.
80 Character class syntax [. .] is reserved for future extensions at - line 8.
81 Character class syntax [= =] is reserved for future extensions at - line 9.
82 Character class syntax [: :] belongs inside character classes at - line 10.
83 Character class [:zog:] unknown at - line 20.
84 ########
85 # regcomp.c [S_regclass]
86 $_ = "";
87 use warnings 'regexp' ;
88 /[a-b]/;
89 /[a-\d]/;
90 /[\d-b]/;
91 /[\s-\d]/;
92 /[\d-\s]/;
93 /[a-[:digit:]]/;
94 /[[:digit:]-b]/;
95 /[[:alpha:]-[:digit:]]/;
96 /[[:digit:]-[:alpha:]]/;
97 no warnings 'regexp' ;
98 /[a-b]/;
99 /[a-\d]/;
100 /[\d-b]/;
101 /[\s-\d]/;
102 /[\d-\s]/;
103 /[a-[:digit:]]/;
104 /[[:digit:]-b]/;
105 /[[:alpha:]-[:digit:]]/;
106 /[[:digit:]-[:alpha:]]/;
107 EXPECT
108 /[a-\d]/: false [] range "a-\d" in regexp at - line 5.
109 /[\d-b]/: false [] range "\d-" in regexp at - line 6.
110 /[\s-\d]/: false [] range "\s-" in regexp at - line 7.
111 /[\d-\s]/: false [] range "\d-" in regexp at - line 8.
112 /[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 9.
113 /[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 10.
114 /[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 11.
115 /[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 12.
116 ########
117 # regcomp.c [S_regclassutf8]
118 BEGIN {
119     if (ord("\t") == 5) {
120         print "SKIPPED\n# ebcdic regular expression ranges differ.";
121         exit 0;
122     }
123 }
124 use utf8;
125 $_ = "";
126 use warnings 'regexp' ;
127 /[a-b]/;
128 /[a-\d]/;
129 /[\d-b]/;
130 /[\s-\d]/;
131 /[\d-\s]/;
132 /[a-[:digit:]]/;
133 /[[:digit:]-b]/;
134 /[[:alpha:]-[:digit:]]/;
135 /[[:digit:]-[:alpha:]]/;
136 no warnings 'regexp' ;
137 /[a-b]/;
138 /[a-\d]/;
139 /[\d-b]/;
140 /[\s-\d]/;
141 /[\d-\s]/;
142 /[a-[:digit:]]/;
143 /[[:digit:]-b]/;
144 /[[:alpha:]-[:digit:]]/;
145 /[[:digit:]-[:alpha:]]/;
146 EXPECT
147 /[a-\d]/: false [] range "a-\d" in regexp at - line 12.
148 /[\d-b]/: false [] range "\d-" in regexp at - line 13.
149 /[\s-\d]/: false [] range "\s-" in regexp at - line 14.
150 /[\d-\s]/: false [] range "\d-" in regexp at - line 15.
151 /[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 16.
152 /[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 17.
153 /[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 18.
154 /[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 19.
155 ########
156 # regcomp.c [S_regclass S_regclassutf8]
157 use warnings 'regexp' ;
158 $a =~ /[a\zb]/ ;
159 no warnings 'regexp' ;
160 $a =~ /[a\zb]/ ;
161 EXPECT
162 /[a\zb]/: Unrecognized escape \z in character class passed through at - line 3.