was Re: [ID 19991102.003] perl on os390
[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 /[[:zog:]]/;
72 EXPECT
73 Character class syntax [: :] belongs inside character classes at - line 4.
74 Character class syntax [. .] belongs inside character classes at - line 5.
75 Character class syntax [. .] is reserved for future extensions at - line 5.
76 Character class syntax [= =] belongs inside character classes at - line 6.
77 Character class syntax [= =] is reserved for future extensions at - line 6.
78 Character class syntax [. .] is reserved for future extensions at - line 8.
79 Character class syntax [= =] is reserved for future extensions at - line 9.
80 Character class syntax [: :] belongs inside character classes at - line 10.
81 Character class [:zog:] unknown at - line 19.
82 ########
83 # regcomp.c [S_regclass]
84 $_ = "";
85 use warnings 'unsafe' ;
86 /[a-b]/;
87 /[a-\d]/;
88 /[\d-b]/;
89 /[\s-\d]/;
90 /[\d-\s]/;
91 /[a-[:digit:]]/;
92 /[[:digit:]-b]/;
93 /[[:alpha:]-[:digit:]]/;
94 /[[:digit:]-[:alpha:]]/;
95 no warnings 'unsafe' ;
96 /[a-b]/;
97 /[a-\d]/;
98 /[\d-b]/;
99 /[\s-\d]/;
100 /[\d-\s]/;
101 /[a-[:digit:]]/;
102 /[[:digit:]-b]/;
103 /[[:alpha:]-[:digit:]]/;
104 /[[:digit:]-[:alpha:]]/;
105 EXPECT
106 /[a-\d]/: false [] range "a-\d" in regexp at - line 5.
107 /[\d-b]/: false [] range "\d-" in regexp at - line 6.
108 /[\s-\d]/: false [] range "\s-" in regexp at - line 7.
109 /[\d-\s]/: false [] range "\d-" in regexp at - line 8.
110 /[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 9.
111 /[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 10.
112 /[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 11.
113 /[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 12.
114 ########
115 # regcomp.c [S_regclassutf8]
116 use utf8;
117 $_ = "";
118 use warnings 'unsafe' ;
119 /[a-b]/;
120 /[a-\d]/;
121 /[\d-b]/;
122 /[\s-\d]/;
123 /[\d-\s]/;
124 /[a-[:digit:]]/;
125 /[[:digit:]-b]/;
126 /[[:alpha:]-[:digit:]]/;
127 /[[:digit:]-[:alpha:]]/;
128 no warnings 'unsafe' ;
129 /[a-b]/;
130 /[a-\d]/;
131 /[\d-b]/;
132 /[\s-\d]/;
133 /[\d-\s]/;
134 /[a-[:digit:]]/;
135 /[[:digit:]-b]/;
136 /[[:alpha:]-[:digit:]]/;
137 /[[:digit:]-[:alpha:]]/;
138 EXPECT
139 /[a-\d]/: false [] range "a-\d" in regexp at - line 6.
140 /[\d-b]/: false [] range "\d-" in regexp at - line 7.
141 /[\s-\d]/: false [] range "\s-" in regexp at - line 8.
142 /[\d-\s]/: false [] range "\d-" in regexp at - line 9.
143 /[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 10.
144 /[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 11.
145 /[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 12.
146 /[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 13.
147 ########
148 # regcomp.c [S_regclass S_regclassutf8]
149 use warnings 'unsafe' ;
150 $a =~ /[a\zb]/ ;
151 no warnings 'unsafe' ;
152 $a =~ /[a\zb]/ ;
153 EXPECT
154 /[a\zb]/: Unrecognized escape \z in character class passed through at - line 3.