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