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