.
[glibc/history.git] / posix / PTESTS
blob02b357cf2e345e13da19f22c3fe66fbaa8f796d2
1 # 2.8.2  Regular Expression General Requirement
2 2¦4¦bb*¦abbbc¦
3 2¦2¦bb*¦ababbbc¦
4 7¦9¦A#*::¦A:A#:qA::qA#::qA##::q¦
5 1¦5¦A#*::¦A##::A#::qA::qA#:q¦
6 # 2.8.3.1.2  BRE Special Characters
7 # GA108
8 2¦2¦\.¦a.c¦
9 2¦2¦\[¦a[c¦
10 2¦2¦\\¦a\c¦
11 2¦2¦\*¦a*c¦
12 2¦2¦\^¦a^c¦
13 2¦2¦\$¦a$c¦
14 7¦11¦X\*Y\*8¦Y*8X*8X*Y*8¦
15 # GA109
16 2¦2¦[.]¦a.c¦
17 2¦2¦[[]¦a[c¦
18 -1¦-1¦[[]¦ac¦
19 2¦2¦[\]¦a\c¦
20 1¦1¦[\a]¦abc¦
21 2¦2¦[\.]¦a\.c¦
22 2¦2¦[\.]¦a.\c¦
23 2¦2¦[*]¦a*c¦
24 2¦2¦[$]¦a$c¦
25 2¦2¦[X*Y8]¦7*8YX¦
26 # GA110
27 2¦2¦*¦a*c¦
28 3¦4¦*a¦*b*a*c¦
29 1¦5¦**9=¦***9=9¦
30 # GA111
31 1¦1¦^*¦*bc¦
32 -1¦-1¦^*¦a*c¦
33 -1¦-1¦^*¦^*ab¦
34 1¦5¦^**9=¦***9=¦
35 -1¦-1¦^*5<*9¦5<9*5<*9¦
36 # GA112
37 2¦3¦\(*b\)¦a*b¦
38 -1¦-1¦\(*b\)¦ac¦
39 1¦6¦A\(**9\)=¦A***9=79¦
40 # GA113(1)
41 1¦3¦\(^*ab\)¦*ab¦
42 -1¦-1¦\(^*ab\)¦^*ab¦
43 -1¦-1¦\(^*b\)¦a*b¦
44 -1¦-1¦\(^*b\)¦^*b¦
45 ### GA113(2)                    GNU regex implements GA113(1)
46 ##-1¦-1¦\(^*ab\)¦*ab¦
47 ##-1¦-1¦\(^*ab\)¦^*ab¦
48 ##1¦1¦\(^*b\)¦b¦
49 ##1¦3¦\(^*b\)¦^^b¦
50 # GA114
51 1¦3¦a^b¦a^b¦
52 1¦3¦a\^b¦a^b¦
53 1¦1¦^^¦^bc¦
54 2¦2¦\^¦a^c¦
55 1¦1¦[c^b]¦^abc¦
56 1¦1¦[\^ab]¦^ab¦
57 2¦2¦[\^ab]¦c\d¦
58 -1¦-1¦[^^]¦^¦
59 1¦3¦\(a^b\)¦a^b¦
60 1¦3¦\(a\^b\)¦a^b¦
61 2¦2¦\(\^\)¦a^b¦
62 # GA115
63 3¦3¦$$¦ab$¦
64 -1¦-1¦$$¦$ab¦
65 2¦3¦$c¦a$c¦
66 2¦2¦[$]¦a$c¦
67 1¦2¦\$a¦$a¦
68 3¦3¦\$$¦ab$¦
69 2¦6¦A\([34]$[34]\)B¦XA4$3BY¦
70 # 2.8.3.1.3  Periods in BREs
71 # GA116
72 1¦1¦.¦abc¦
73 -1¦-1¦.ab¦abc¦
74 1¦3¦ab.¦abc¦
75 1¦3¦a.b¦a,b¦
76 -1¦-1¦.......¦PqRs6¦
77 1¦7¦.......¦PqRs6T8¦
78 # 2.8.3.2  RE Bracket Expression
79 # GA118
80 2¦2¦[abc]¦xbyz¦
81 -1¦-1¦[abc]¦xyz¦
82 2¦2¦[abc]¦xbay¦
83 # GA119
84 2¦2¦[^a]¦abc¦
85 4¦4¦[^]cd]¦cd]ef¦
86 2¦2¦[^abc]¦axyz¦
87 -1¦-1¦[^abc]¦abc¦
88 3¦3¦[^[.a.]b]¦abc¦
89 3¦3¦[^[=a=]b]¦abc¦
90 2¦2¦[^-ac]¦abcde-¦
91 2¦2¦[^ac-]¦abcde-¦
92 3¦3¦[^a-b]¦abcde¦
93 3¦3¦[^a-bd-e]¦dec¦
94 2¦2¦[^---]¦-ab¦
95 16¦16¦[^a-zA-Z0-9]¦pqrstVWXYZ23579#¦
96 # GA120(1)
97 3¦3¦[]a]¦cd]ef¦
98 1¦1¦[]-a]¦a_b¦
99 3¦3¦[][.-.]-0]¦ab0-]¦
100 1¦1¦[]^a-z]¦string¦
101 # GA120(2)
102 4¦4¦[^]cd]¦cd]ef¦
103 0¦0¦[^]]*¦]]]]]]]]X¦
104 0¦0¦[^]]*¦]]]]]]]]¦
105 9¦9¦[^]]\{1,\}¦]]]]]]]]X¦
106 -1¦-1¦[^]]\{1,\}¦]]]]]]]]¦
107 # GA120(3)
108 3¦3¦[c[.].]d]¦ab]cd¦
109 2¦8¦[a-z]*[[.].]][A-Z]*¦Abcd]DEFg¦
110 # GA121
111 2¦2¦[[.a.]b]¦Abc¦
112 1¦1¦[[.a.]b]¦aBc¦
113 -1¦-1¦[[.a.]b]¦ABc¦
114 3¦3¦[^[.a.]b]¦abc¦
115 3¦3¦[][.-.]-0]¦ab0-]¦
116 3¦3¦[A-[.].]c]¦ab]!¦
117 # GA122
118 -2¦-2¦[[.ch.]]¦abc¦
119 -2¦-2¦[[.ab.][.CD.][.EF.]]¦yZabCDEFQ9¦
120 # GA125
121 2¦2¦[[=a=]b]¦Abc¦
122 1¦1¦[[=a=]b]¦aBc¦
123 -1¦-1¦[[=a=]b]¦ABc¦
124 3¦3¦[^[=a=]b]¦abc¦
125 # GA126
126 #W the expected result for [[:alnum:]]* is 2-7 which is wrong
127 0¦0¦[[:alnum:]]*¦ aB28gH¦
128 2¦7¦[[:alnum:]][[:alnum:]]*¦ aB28gH¦
129 #W the expected result for [^[:alnum:]]* is 2-5 which is wrong
130 0¦0¦[^[:alnum:]]*¦2     ,\x7f
131 2¦5¦[^[:alnum:]][^[:alnum:]]*¦2         ,\x7f
132 #W the expected result for [[:alpha:]]* is 2-5 which is wrong
133 0¦0¦[[:alpha:]]*¦ aBgH2¦
134 2¦5¦[[:alpha:]][[:alpha:]]*¦ aBgH2¦
135 1¦6¦[^[:alpha:]]*¦2     8,\x7f
136 1¦2¦[[:blank:]]*¦       \r\x7f¦
137 1¦8¦[^[:blank:]]*¦aB28gH,\x7f ¦
138 1¦2¦[[:cntrl:]]*¦       \x7f ¦
139 1¦8¦[^[:cntrl:]]*¦aB2 8gh,¦
140 #W the expected result for [[:digit:]]* is 2-3 which is wrong
141 0¦0¦[[:digit:]]*¦a28¦
142 2¦3¦[[:digit:]][[:digit:]]*¦a28¦
143 1¦8¦[^[:digit:]]*¦aB    gH,\x7f¦
144 1¦7¦[[:graph:]]*¦aB28gH, ¦
145 1¦3¦[^[:graph:]]*¦      \x7f
146 1¦2¦[[:lower:]]*¦agB¦
147 1¦8¦[^[:lower:]]*¦B2    8H,\x7f
148 1¦8¦[[:print:]]*¦aB2 8gH,       ¦
149 1¦2¦[^[:print:]]*¦      \x7f ¦
150 #W the expected result for [[:punct:]]* is 2-2 which is wrong
151 0¦0¦[[:punct:]]*¦a,2¦
152 2¦3¦[[:punct:]][[:punct:]]*¦a,,2¦
153 1¦9¦[^[:punct:]]*¦aB2   8gH\x7f¦
154 1¦3¦[[:space:]]*¦       \r\x7f¦
155 #W the expected result for [^[:space:]]* is 2-9 which is wrong
156 0¦0¦[^[:space:]]*¦ aB28gH,\x7f     ¦
157 2¦9¦[^[:space:]][^[:space:]]*¦ aB28gH,\x7f ¦
158 #W the expected result for [[:upper:]]* is 2-3 which is wrong
159 0¦0¦[[:upper:]]*¦aBH2¦
160 2¦3¦[[:upper:]][[:upper:]]*¦aBH2¦
161 1¦8¦[^[:upper:]]*¦a2    8g,\x7f
162 #W the expected result for [[:xdigit:]]* is 2-5 which is wrong
163 0¦0¦[[:xdigit:]]*¦gaB28h¦
164 2¦5¦[[:xdigit:]][[:xdigit:]]*¦gaB28h¦
165 #W the expected result for [^[:xdigit:]]* is 2-7 which is wrong
166 2¦7¦[^[:xdigit:]][^[:xdigit:]]*¦a       gH,\x7f
167 # GA127
168 -2¦-2¦[b-a]¦abc¦
169 1¦1¦[a-c]¦bbccde¦
170 2¦2¦[a-b]¦-bc¦
171 3¦3¦[a-z0-9]¦AB0¦
172 3¦3¦[^a-b]¦abcde¦
173 3¦3¦[^a-bd-e]¦dec¦
174 1¦1¦[]-a]¦a_b¦
175 2¦2¦[+--]¦a,b¦
176 2¦2¦[--/]¦a.b¦
177 2¦2¦[^---]¦-ab¦
178 3¦3¦[][.-.]-0]¦ab0-]¦
179 3¦3¦[A-[.].]c]¦ab]!¦
180 2¦6¦bc[d-w]xy¦abchxyz¦
181 # GA129
182 1¦1¦[a-cd-f]¦dbccde¦
183 -1¦-1¦[a-ce-f]¦dBCCdE¦
184 2¦4¦b[n-zA-M]Y¦absY9Z¦
185 2¦4¦b[n-zA-M]Y¦abGY9Z¦
186 # GA130
187 3¦3¦[-xy]¦ac-¦
188 2¦4¦c[-xy]D¦ac-D+¦
189 2¦2¦[--/]¦a.b¦
190 2¦4¦c[--/]D¦ac.D+b¦
191 2¦2¦[^-ac]¦abcde-¦
192 1¦3¦a[^-ac]c¦abcde-¦
193 3¦3¦[xy-]¦zc-¦
194 2¦4¦c[xy-]7¦zc-786¦
195 2¦2¦[^ac-]¦abcde-¦
196 2¦4¦a[^ac-]c¦5abcde-¦
197 2¦2¦[+--]¦a,b¦
198 2¦4¦a[+--]B¦Xa,By¦
199 2¦2¦[^---]¦-ab¦
200 4¦6¦X[^---]Y¦X-YXaYXbY¦
201 # 2.8.3.3  BREs Matching Multiple Characters
202 # GA131
203 3¦4¦cd¦abcdeabcde¦
204 1¦2¦ag*b¦abcde¦
205 -1¦-1¦[a-c][e-f]¦abcdef¦
206 3¦4¦[a-c][e-f]¦acbedf¦
207 4¦8¦abc*XYZ¦890abXYZ#*¦
208 4¦9¦abc*XYZ¦890abcXYZ#*¦
209 4¦15¦abc*XYZ¦890abcccccccXYZ#*¦
210 -1¦-1¦abc*XYZ¦890abc*XYZ#*¦
211 # GA132
212 2¦4¦\(*bc\)¦a*bc¦
213 1¦2¦\(ab\)¦abcde¦
214 1¦10¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(j\)\)\)\)\)\)\)\)¦abcdefghijk¦
215 3¦8¦43\(2\(6\)*0\)AB¦654320ABCD¦
216 3¦9¦43\(2\(7\)*0\)AB¦6543270ABCD¦
217 3¦12¦43\(2\(7\)*0\)AB¦6543277770ABCD¦
218 # GA133
219 1¦10¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(j\)\)\)\)\)\)\)\)¦abcdefghijk¦
220 -1¦-1¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(k\)\)\)\)\)\)\)\)¦abcdefghijk¦
221 # GA134
222 2¦4¦\(bb*\)¦abbbc¦
223 2¦2¦\(bb*\)¦ababbbc¦
224 1¦6¦a\(.*b\)¦ababbbc¦
225 1¦2¦a\(b*\)¦ababbbc¦
226 1¦20¦a\(.*b\)c¦axcaxbbbcsxbbbbbbbbc¦
227 # GA135
228 1¦7¦\(a\(b\(c\(d\(e\)\)\)\)\)\4¦abcdededede¦
229 #W POSIX does not really specify whether a\(b\)*c\1 matches acb.
230 #W back references are supposed to expand to the last match, but what
231 #W if there never was a match as in this case?
232 -1¦-1¦a\(b\)*c\1¦acb¦
233 1¦11¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(j\)\)\)\)\)\)\)\)\9¦abcdefghijjk¦
234 # GA136
235 #W These two tests have the same problem as the test in GA135.  No match
236 #W of a subexpression, why should the back reference be usable?
237 #W 1 2 a\(b\)*c\1 acb
238 #W 4 7 a\(b\(c\(d\(f\)*\)\)\)\4¦xYzabcdePQRST
239 -1¦-1¦a\(b\)*c\1¦acb¦
240 -1¦-1¦a\(b\(c\(d\(f\)*\)\)\)\4¦xYzabcdePQRST¦
241 # GA137
242 -2¦-2¦\(a\(b\)\)\3¦foo¦
243 -2¦-2¦\(a\(b\)\)\(a\(b\)\)\5¦foo¦
244 # GA138
245 1¦2¦ag*b¦abcde¦
246 1¦10¦a.*b¦abababvbabc¦
247 2¦5¦b*c¦abbbcdeabbbbbbcde¦
248 2¦5¦bbb*c¦abbbcdeabbbbbbcde¦
249 1¦5¦a\(b\)*c\1¦abbcbbb¦
250 -1¦-1¦a\(b\)*c\1¦abbdbd¦
251 0¦0¦\([a-c]*\)\1¦abcacdef¦
252 1¦6¦\([a-c]*\)\1¦abcabcabcd¦
253 1¦2¦a^*b¦ab¦
254 1¦5¦a^*b¦a^^^b¦
255 # GA139
256 1¦2¦a\{2\}¦aaaa¦
257 1¦7¦\([a-c]*\)\{0,\}¦aabcaab¦
258 1¦2¦\(a\)\1\{1,2\}¦aabc¦
259 1¦3¦\(a\)\1\{1,2\}¦aaaabc¦
260 #W the expression \(\(a\)\1\)\{1,2\} is ill-formed, using \2
261 1¦4¦\(\(a\)\2\)\{1,2\}¦aaaabc¦
262 # GA140
263 1¦2¦a\{2\}¦aaaa¦
264 -1¦-1¦a\{2\}¦abcd¦
265 0¦0¦a\{0\}¦aaaa¦
266 1¦64¦a\{64\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦
267 # GA141
268 1¦7¦\([a-c]*\)\{0,\}¦aabcaab¦
269 #W the expected result for \([a-c]*\)\{2,\} is failure which isn't correct
270 1¦3¦\([a-c]*\)\{2,\}¦abcdefg¦
271 1¦3¦\([a-c]*\)\{1,\}¦abcdefg¦
272 -1¦-1¦a\{64,\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦
273 # GA142
274 1¦3¦a\{2,3\}¦aaaa¦
275 -1¦-1¦a\{2,3\}¦abcd¦
276 0¦0¦\([a-c]*\)\{0,0\}¦foo¦
277 1¦63¦a\{1,63\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦
278 # 2.8.3.4  BRE Precedence
279 # GA143
280 #W There are numerous bugs in the original version.
281 2¦19¦\^\[[[.].]]\\(\\1\\)\*\\{1,2\\}\$¦a^[]\(\1\)*\{1,2\}$b¦
282 1¦6¦[[=*=]][[=\=]][[=]=]][[===]][[...]][[:punct:]]¦*\]=.;¦
283 1¦6¦[$\(*\)^]*¦$\()*^¦
284 1¦1¦[\1]¦1¦
285 1¦1¦[\{1,2\}]¦{¦
286 #W the expected result for \(*\)*\1* is 2-2 which isn't correct
287 0¦0¦\(*\)*\1*¦a*b*11¦
288 2¦3¦\(*\)*\1*b¦a*b*11¦
289 #W the expected result for \(a\(b\{1,2\}\)\{1,2\}\) is 1-5 which isn't correct
290 1¦3¦\(a\(b\{1,2\}\)\{1,2\}\)¦abbab¦
291 1¦5¦\(a\(b\{1,2\}\)\)\{1,2\}¦abbab¦
292 1¦1¦^\(^\(^a$\)$\)$¦a¦
293 1¦2¦\(a\)\1$¦aa¦
294 1¦3¦ab*¦abb¦
295 1¦4¦ab\{2,4\}¦abbbc¦
296 # 2.8.3.5  BRE Expression Anchoring
297 # GA144
298 1¦1¦^a¦abc¦
299 -1¦-1¦^b¦abc¦
300 -1¦-1¦^[a-zA-Z]¦99Nine¦
301 1¦4¦^[a-zA-Z]*¦Nine99¦
302 # GA145(1)
303 1¦2¦\(^a\)\1¦aabc¦
304 -1¦-1¦\(^a\)\1¦^a^abc¦
305 1¦2¦\(^^a\)¦^a¦
306 1¦1¦\(^^\)¦^^¦
307 1¦3¦\(^abc\)¦abcdef¦
308 -1¦-1¦\(^def\)¦abcdef¦
309 ### GA145(2)                    GNU regex implements GA145(1)
310 ##-1¦-1¦\(^a\)\1¦aabc¦
311 ##1¦4¦\(^a\)\1¦^a^abc¦
312 ##-1¦-1¦\(^^a\)¦^a¦
313 ##1¦2¦\(^^\)¦^^¦
314 # GA146
315 3¦3¦a$¦cba¦
316 -1¦-1¦a$¦abc¦
317 5¦7¦[a-z]*$¦99ZZxyz¦
318 #W the expected result for [a-z]*$ is failure which isn't correct
319 10¦9¦[a-z]*$¦99ZZxyz99¦
320 3¦3¦$$¦ab$¦
321 -1¦-1¦$$¦$ab¦
322 3¦3¦\$$¦ab$¦
323 # GA147(1)
324 -1¦-1¦\(a$\)\1¦bcaa¦
325 -1¦-1¦\(a$\)\1¦ba$¦
326 -1¦-1¦\(ab$\)¦ab$¦
327 1¦2¦\(ab$\)¦ab¦
328 4¦6¦\(def$\)¦abcdef¦
329 -1¦-1¦\(abc$\)¦abcdef¦
330 ### GA147(2)                    GNU regex implements GA147(1)
331 ##-1¦-1¦\(a$\)\1¦bcaa¦
332 ##2¦5¦\(a$\)\1¦ba$a$¦
333 ##-1¦-1¦\(ab$\)¦ab¦
334 ##1¦3¦\(ab$\)¦ab$¦
335 # GA148
336 0¦0¦^$¦¦
337 1¦3¦^abc$¦abc¦
338 -1¦-1¦^xyz$¦^xyz^¦
339 -1¦-1¦^234$¦^234$¦
340 1¦9¦^[a-zA-Z0-9]*$¦2aA3bB9zZ¦
341 -1¦-1¦^[a-z0-9]*$¦2aA3b#B9zZ¦