Commit | Line | Data |
---|---|---|
ca8ffed2 | 1 | __END__ |
b255a112 FC |
2 | # NAME foo found where operator expected |
3 | myfunc 1,2,3 | |
4 | EXPECT | |
5 | Number found where operator expected at - line 1, near "myfunc 1" | |
6 | (Do you need to predeclare myfunc?) | |
7 | syntax error at - line 1, near "myfunc 1" | |
8 | Execution of - aborted due to compilation errors. | |
9 | ######## | |
10 | # NAME foo found where operator expected (after strict error, w/fatal warnings) | |
11 | use warnings FATAL => 'all'; | |
12 | use strict; | |
13 | $foo; | |
14 | myfunc 1,2,3 | |
15 | EXPECT | |
16 | Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?) at - line 3. | |
17 | Number found where operator expected at - line 4, near "myfunc 1" | |
18 | (Do you need to predeclare myfunc?) | |
19 | syntax error at - line 4, near "myfunc 1" | |
20 | Execution of - aborted due to compilation errors. | |
21 | ######## | |
488bc579 FC |
22 | # NAME (Missing operator before ${?) [perl #123737] |
23 | 0${ | |
24 | EXPECT | |
25 | Scalar found where operator expected at - line 1, near "0${" | |
26 | (Missing operator before ${?) | |
27 | syntax error at - line 1, near "0$" | |
28 | Missing right curly or square bracket at - line 1, at end of line | |
29 | Execution of - aborted due to compilation errors. | |
30 | ######## | |
310a0d0a DM |
31 | # NAME (Missing operator before $#{?) [perl #123737] |
32 | 0$#{ | |
33 | EXPECT | |
34 | Array length found where operator expected at - line 1, near "0$#{" | |
35 | (Missing operator before $#{?) | |
36 | syntax error at - line 1, near "0$#" | |
37 | Missing right curly or square bracket at - line 1, at end of line | |
38 | Execution of - aborted due to compilation errors. | |
39 | ######## | |
61d30259 | 40 | # NAME (Missing operator before @foo) [perl #123737] |
a7162bf7 TC |
41 | 0@foo |
42 | EXPECT | |
43 | Array found where operator expected at - line 1, near "0@foo" | |
44 | (Missing operator before @foo?) | |
45 | syntax error at - line 1, near "0@foo | |
46 | " | |
47 | Execution of - aborted due to compilation errors. | |
48 | ######## | |
61d30259 TC |
49 | # NAME (Missing operator before @{) [perl #123737] |
50 | 0@{ | |
51 | EXPECT | |
52 | Array found where operator expected at - line 1, near "0@{" | |
53 | (Missing operator before @{?) | |
54 | syntax error at - line 1, near "0@" | |
55 | Missing right curly or square bracket at - line 1, at end of line | |
56 | Execution of - aborted due to compilation errors. | |
57 | ######## | |
5af08aed FC |
58 | # NAME Unterminated here-doc in string eval |
59 | eval "<<foo"; die $@ | |
60 | EXPECT | |
61 | Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1. | |
62 | ######## | |
63 | # NAME Unterminated here-doc in s/// string eval | |
64 | eval "s//<<foo/e"; die $@ | |
65 | EXPECT | |
66 | Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1. | |
67 | ######## | |
fd2709db FC |
68 | # NAME Unterminated here-doc in string |
69 | "${<<foo"; # Used to give ‘Attempt to free blah blah blah’ | |
70 | EXPECT | |
71 | Can't find string terminator "foo" anywhere before EOF at - line 1. | |
72 | ######## | |
7f7f7d08 FC |
73 | # NAME Unterminated here-doc with non-Latin-1 terminator |
74 | BEGIN { binmode STDERR, ":utf8" } | |
75 | use utf8; | |
76 | <<옷옷 | |
77 | EXPECT | |
78 | Can't find string terminator "옷옷" anywhere before EOF at - line 3. | |
79 | ######## | |
20ed5f00 FC |
80 | # NAME Unterminated qw// |
81 | qw/ | |
82 | EXPECT | |
83 | Can't find string terminator "/" anywhere before EOF at - line 1. | |
84 | ######## | |
85 | # NAME Unterminated q// | |
86 | qw/ | |
87 | EXPECT | |
88 | Can't find string terminator "/" anywhere before EOF at - line 1. | |
89 | ######## | |
90 | # NAME Unterminated '' | |
91 | ' | |
92 | EXPECT | |
93 | Can't find string terminator "'" anywhere before EOF at - line 1. | |
94 | ######## | |
1b8d3e0e LM |
95 | # NAME Unterminated "" |
96 | " | |
97 | EXPECT | |
98 | Can't find string terminator '"' anywhere before EOF at - line 1. | |
99 | ######## | |
cb650135 FC |
100 | # NAME Unterminated q// with non-ASCII delimiter, under utf8 |
101 | BEGIN { binmode STDERR, ":utf8" } | |
102 | use utf8; | |
103 | q« | |
104 | EXPECT | |
105 | Can't find string terminator "«" anywhere before EOF at - line 3. | |
106 | ######## | |
107 | # NAME Unterminated q// with non-Latin-1 delimiter | |
108 | BEGIN { binmode STDERR, ":utf8" } | |
109 | use utf8; | |
110 | q 옷 | |
111 | EXPECT | |
112 | Can't find string terminator "옷" anywhere before EOF at - line 3. | |
113 | ######## | |
4407f1b8 FC |
114 | # NAME /\N{/ |
115 | /\N{/ | |
116 | EXPECT | |
117 | Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern | |
ca53e5d5 | 118 | Execution of - aborted due to compilation errors. |
4407f1b8 | 119 | ######## |
e660c409 FC |
120 | # NAME map{for our *a... |
121 | map{for our *a (1..10) {$_.=$x}} | |
122 | EXPECT | |
123 | Missing $ on loop variable at - line 1. | |
124 | ######## | |
ca8ffed2 | 125 | # NAME Missing name in "my sub" |
e7d0b801 | 126 | use feature 'lexical_subs'; my sub; |
ca8ffed2 FC |
127 | EXPECT |
128 | Missing name in "my sub" at - line 1. | |
6f2d7fc9 | 129 | ######## |
8767b1ab | 130 | # NAME Missing name in "our sub" |
e7d0b801 | 131 | use feature 'lexical_subs'; our sub; |
8767b1ab FC |
132 | EXPECT |
133 | Missing name in "our sub" at - line 1. | |
134 | ######## | |
135 | # NAME Missing name in "state sub" | |
60e04ba1 | 136 | use 5.01; |
8767b1ab FC |
137 | state sub; |
138 | EXPECT | |
139 | Missing name in "state sub" at - line 2. | |
140 | ######## | |
b9a58d50 FC |
141 | # NAME our sub pack::foo |
142 | our sub foo::bar; | |
143 | EXPECT | |
144 | No package name allowed for subroutine &foo::bar in "our" at - line 1, near "our sub foo::bar" | |
145 | Execution of - aborted due to compilation errors. | |
146 | ######## | |
a21eb52b FC |
147 | # NAME my sub pack::foo |
148 | use feature 'lexical_subs', 'state'; | |
149 | my sub foo::bar; | |
150 | state sub foo::bear; | |
151 | EXPECT | |
a21eb52b FC |
152 | "my" subroutine &foo::bar can't be in a package at - line 2, near "my sub foo::bar" |
153 | "state" subroutine &foo::bear can't be in a package at - line 3, near "state sub foo::bear" | |
154 | Execution of - aborted due to compilation errors. | |
155 | ######## | |
b2e3d01a FC |
156 | # NAME Integer constant overloading returning undef |
157 | use overload; | |
247a7f40 FC |
158 | BEGIN { overload::constant integer => sub {}; undef *^H } |
159 | 1 | |
160 | EXPECT | |
bb4784f0 | 161 | Constant(1) unknown at - line 3, at end of line |
247a7f40 FC |
162 | Execution of - aborted due to compilation errors. |
163 | ######## | |
164 | # NAME Float constant overloading returning undef | |
165 | use overload; | |
166 | BEGIN { overload::constant float => sub {}; undef *^H } | |
167 | 1.1 | |
168 | EXPECT | |
bb4784f0 | 169 | Constant(1.1) unknown at - line 3, at end of line |
247a7f40 FC |
170 | Execution of - aborted due to compilation errors. |
171 | ######## | |
172 | # NAME Binary constant overloading returning undef | |
173 | use overload; | |
174 | BEGIN { overload::constant binary => sub {}; undef *^H } | |
175 | 0x1 | |
176 | EXPECT | |
bb4784f0 | 177 | Constant(0x1) unknown at - line 3, at end of line |
247a7f40 FC |
178 | Execution of - aborted due to compilation errors. |
179 | ######## | |
180 | # NAME String constant overloading returning undef | |
181 | use overload; | |
182 | BEGIN { overload::constant q => sub {}; undef *^H } | |
183 | '1', "1$_", tr"a"", s""a" | |
184 | EXPECT | |
185 | Constant(q) unknown at - line 3, near "'1'" | |
186 | Constant(qq) unknown at - line 3, within string | |
187 | Constant(tr) unknown at - line 3, within string | |
188 | Constant(s) unknown at - line 3, within string | |
189 | Execution of - aborted due to compilation errors. | |
190 | ######## | |
191 | # NAME Regexp constant overloading when *^H is undefined | |
192 | use overload; | |
193 | BEGIN { overload::constant qr => sub {}; undef *^H } | |
efa571ab | 194 | /a/ |
247a7f40 FC |
195 | EXPECT |
196 | Constant(qq) unknown at - line 3, within pattern | |
efa571ab KW |
197 | Execution of - aborted due to compilation errors. |
198 | ######## | |
199 | # NAME Regexp constant overloading when *^H is undefined | |
200 | use overload; | |
201 | BEGIN { overload::constant qr => sub {}; undef *^H } | |
202 | m'a' | |
203 | EXPECT | |
247a7f40 FC |
204 | Constant(q) unknown at - line 3, within pattern |
205 | Execution of - aborted due to compilation errors. | |
206 | ######## | |
207 | # NAME \N{...} when charnames fails to load but without an error | |
d4ead2eb | 208 | # SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0 |
247a7f40 FC |
209 | BEGIN { ++$_ for @INC{"charnames.pm","_charnames.pm"} } |
210 | "\N{a}" | |
211 | EXPECT | |
212 | Constant(\N{a}) unknown at - line 2, within string | |
213 | Execution of - aborted due to compilation errors. | |
214 | ######## | |
215 | # NAME Integer constant overloading returning undef | |
216 | use overload; | |
b2e3d01a FC |
217 | BEGIN { overload::constant integer => sub {} } |
218 | 1 | |
219 | EXPECT | |
bb4784f0 | 220 | Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line |
b2e3d01a FC |
221 | Execution of - aborted due to compilation errors. |
222 | ######## | |
223 | # NAME Float constant overloading returning undef | |
224 | use overload; | |
225 | BEGIN { overload::constant float => sub {} } | |
226 | 1.1 | |
227 | EXPECT | |
bb4784f0 | 228 | Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line |
b2e3d01a FC |
229 | Execution of - aborted due to compilation errors. |
230 | ######## | |
231 | # NAME Binary constant overloading returning undef | |
232 | use overload; | |
233 | BEGIN { overload::constant binary => sub {} } | |
234 | 0x1 | |
235 | EXPECT | |
bb4784f0 | 236 | Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line |
b2e3d01a FC |
237 | Execution of - aborted due to compilation errors. |
238 | ######## | |
239 | # NAME String constant overloading returning undef | |
240 | use overload; | |
241 | BEGIN { overload::constant q => sub {} } | |
242 | '1', "1$_", tr"a"", s""a" | |
243 | EXPECT | |
244 | Constant(q): Call to &{$^H{q}} did not return a defined value at - line 3, near "'1'" | |
245 | Constant(qq): Call to &{$^H{q}} did not return a defined value at - line 3, within string | |
246 | Constant(tr): Call to &{$^H{q}} did not return a defined value at - line 3, within string | |
247 | Constant(s): Call to &{$^H{q}} did not return a defined value at - line 3, within string | |
248 | Execution of - aborted due to compilation errors. | |
249 | ######## | |
250 | # NAME Regexp constant overloading returning undef | |
251 | use overload; | |
252 | BEGIN { overload::constant qr => sub {} } | |
efa571ab | 253 | /a/ |
b2e3d01a FC |
254 | EXPECT |
255 | Constant(qq): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern | |
efa571ab KW |
256 | Execution of - aborted due to compilation errors. |
257 | ######## | |
258 | # NAME Regexp constant overloading returning undef | |
259 | use overload; | |
260 | BEGIN { overload::constant qr => sub {} } | |
261 | m'a' | |
262 | EXPECT | |
b2e3d01a FC |
263 | Constant(q): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern |
264 | Execution of - aborted due to compilation errors. | |
265 | ######## | |
67c71cbb FC |
266 | # NAME Failed constant overloading should not cause a double free |
267 | use overload; | |
268 | BEGIN { overload::constant q => sub {}; undef *^H } | |
269 | undef(1,2); | |
270 | undef(1,2); | |
271 | undef(1,2); | |
272 | undef(1,2); | |
273 | undef(1,2); | |
274 | undef(1,2); | |
275 | undef(1,2); | |
276 | undef(1,2); | |
277 | undef(1,2); | |
278 | "a" | |
279 | EXPECT | |
280 | Too many arguments for undef operator at - line 3, near "2)" | |
281 | Too many arguments for undef operator at - line 4, near "2)" | |
282 | Too many arguments for undef operator at - line 5, near "2)" | |
283 | Too many arguments for undef operator at - line 6, near "2)" | |
284 | Too many arguments for undef operator at - line 7, near "2)" | |
285 | Too many arguments for undef operator at - line 8, near "2)" | |
286 | Too many arguments for undef operator at - line 9, near "2)" | |
287 | Too many arguments for undef operator at - line 10, near "2)" | |
288 | Too many arguments for undef operator at - line 11, near "2)" | |
289 | Constant(q) unknown at - line 12, near ""a"" | |
290 | - has too many errors. | |
291 | ######## | |
76b35304 FC |
292 | # NAME Bad name after ' (with other helpful messages) |
293 | sub has{} | |
294 | has erdef => ( | |
295 | isa => 'Int', | |
296 | is => 'ro, | |
297 | default => sub { 1 } | |
298 | ); | |
299 | ||
300 | has cxxc => ( | |
301 | isa => 'Int', | |
302 | is => 'ro', | |
303 | default => sub { 1 } | |
304 | ); | |
305 | EXPECT | |
306 | Bareword found where operator expected at - line 9, near "isa => 'Int" | |
307 | (Might be a runaway multi-line '' string starting on line 4) | |
308 | (Do you need to predeclare isa?) | |
309 | Bad name after Int' at - line 9. | |
310 | ######## | |
311 | # NAME Bad name after :: (with other helpful messages) | |
312 | sub has{} | |
313 | has erdef => ( | |
314 | isa => 'Int', | |
315 | is => "ro, | |
316 | default => sub { 1 } | |
317 | ); | |
318 | ||
319 | has cxxc => ( | |
320 | isa => "Foo::$subpackage", | |
321 | is => 'ro', | |
322 | default => sub { 1 } | |
323 | ); | |
324 | EXPECT | |
325 | Bareword found where operator expected at - line 9, near "isa => "Foo" | |
326 | (Might be a runaway multi-line "" string starting on line 4) | |
327 | (Do you need to predeclare isa?) | |
328 | Bad name after Foo:: at - line 9. | |
329 | ######## | |
6f2d7fc9 FC |
330 | # NAME Unterminated delimiter for here document |
331 | <<"foo | |
332 | EXPECT | |
333 | Unterminated delimiter for here document at - line 1. | |
f3106bc8 LM |
334 | ######## |
335 | # NAME my (our $x) errors | |
336 | my (our $x); | |
337 | EXPECT | |
37808b00 | 338 | Can't redeclare "our" in "my" at - line 1, near "(our" |
f3106bc8 LM |
339 | Execution of - aborted due to compilation errors. |
340 | ######## | |
341 | # NAME our (my $x) errors | |
342 | our (my $x); | |
343 | EXPECT | |
37808b00 | 344 | Can't redeclare "my" in "our" at - line 1, near "(my" |
f3106bc8 LM |
345 | Execution of - aborted due to compilation errors. |
346 | ######## | |
347 | # NAME state (my $x) errors | |
348 | use feature 'state'; | |
349 | state (my $x); | |
350 | EXPECT | |
37808b00 | 351 | Can't redeclare "my" in "state" at - line 2, near "(my" |
f3106bc8 LM |
352 | Execution of - aborted due to compilation errors. |
353 | ######## | |
354 | # NAME our (state $x) errors | |
355 | use feature 'state'; | |
356 | our (state $x); | |
357 | EXPECT | |
37808b00 | 358 | Can't redeclare "state" in "our" at - line 2, near "(state" |
f3106bc8 LM |
359 | Execution of - aborted due to compilation errors. |
360 | ######## | |
361 | # NAME my (my $x) errors | |
362 | my (my $x, $y, $z); | |
363 | EXPECT | |
37808b00 | 364 | Can't redeclare "my" in "my" at - line 1, near "(my" |
f3106bc8 LM |
365 | Execution of - aborted due to compilation errors. |
366 | ######## | |
367 | # NAME our (our $x) errors | |
368 | our ($x, our($y), $z); | |
369 | EXPECT | |
37808b00 | 370 | Can't redeclare "our" in "our" at - line 1, near ", our" |
f3106bc8 LM |
371 | Execution of - aborted due to compilation errors. |
372 | ######## | |
373 | # NAME state (state $x) errors | |
374 | use feature 'state'; | |
375 | state ($x, $y, state $z); | |
376 | EXPECT | |
37808b00 | 377 | Can't redeclare "state" in "state" at - line 2, near ", state" |
f3106bc8 | 378 | Execution of - aborted due to compilation errors. |
e6b2cf83 TC |
379 | ######## |
380 | # NAME BEGIN <> [perl #125341] | |
381 | BEGIN <> | |
382 | EXPECT | |
383 | Illegal declaration of subroutine BEGIN at - line 1. | |
e2733f9a TC |
384 | ######## |
385 | # NAME multiple conflict markers | |
386 | <<<<<<< yours:sample.txt | |
387 | my $some_code; | |
388 | ======= | |
389 | my $some_other_code; | |
390 | >>>>>>> theirs:sample.txt | |
391 | EXPECT | |
392 | Version control conflict marker at - line 1, near "<<<<<<<" | |
393 | Version control conflict marker at - line 3, near "=======" | |
394 | Version control conflict marker at - line 5, near ">>>>>>>" | |
395 | Execution of - aborted due to compilation errors. | |
a3164817 FC |
396 | ######## |
397 | # NAME (Might be a runaway multi-line...) with Latin-1 delimiters in utf8 | |
398 | BEGIN { binmode STDERR, ':utf8' } | |
399 | use utf8; | |
400 | q« | |
401 | « time | |
402 | EXPECT | |
403 | syntax error at - line 4, near "« time" | |
404 | (Might be a runaway multi-line «« string starting on line 3) | |
405 | Execution of - aborted due to compilation errors. | |
406 | ######## | |
407 | # NAME (Might be a runaway multi-line...) with non-Latin-1 delimiters | |
408 | BEGIN { binmode STDERR, ':utf8' } | |
409 | use utf8; | |
410 | q ϡ | |
411 | ϡ time | |
412 | EXPECT | |
413 | syntax error at - line 4, near "ϡ time" | |
414 | (Might be a runaway multi-line ϡϡ string starting on line 3) | |
415 | Execution of - aborted due to compilation errors. | |
59143e29 TC |
416 | ######## |
417 | # NAME tr/// handling of mis-formatted \o characters | |
418 | # may only fail with ASAN | |
419 | tr/\o-0//; | |
420 | EXPECT | |
421 | Missing braces on \o{} at - line 2, within string | |
422 | Execution of - aborted due to compilation errors. | |
c6e25b09 DIM |
423 | ######## |
424 | # NAME bare << | |
425 | $a = <<; | |
426 | ||
427 | EXPECT | |
428 | Use of bare << to mean <<"" is forbidden at - line 1. | |
429 | ######## | |
430 | # NAME bare <<~ | |
431 | $a = <<~; | |
432 | EXPECT | |
433 | Use of bare << to mean <<"" is forbidden at - line 1. | |
434 | ######## | |
435 | # NAME bare <<~ | |
436 | $a = <<~ ; | |
437 | ||
438 | EXPECT | |
439 | Use of bare << to mean <<"" is forbidden at - line 1. | |
adb0f5c4 TC |
440 | ######## |
441 | # NAME incomplete floating point decimal exponent (#131725) | |
442 | 1e--5 | |
443 | EXPECT | |
444 | Bareword found where operator expected at - line 1, near "1e" | |
445 | (Missing operator before e?) | |
446 | Number found where operator expected at - line 1, near "--5" | |
447 | (Missing operator before 5?) | |
448 | syntax error at - line 1, near "1e" | |
449 | Execution of - aborted due to compilation errors. | |
08ccc810 TC |
450 | ######## |
451 | # NAME signature with non-"=" assignop #131777 | |
452 | use feature 'signatures'; | |
453 | no warnings 'experimental::signatures'; | |
454 | sub foo ($a += 1) | |
455 | EXPECT | |
456 | Illegal operator following parameter in a subroutine signature at - line 3, near "($a += 1" | |
457 | syntax error at - line 3, near "($a += 1" | |
458 | Execution of - aborted due to compilation errors. | |
e8d55f27 TC |
459 | ######## |
460 | # NAME tr/// range with empty \N{} at the start | |
461 | tr//\N{}-0/; | |
462 | EXPECT | |
463 | Unknown charname '' at - line 1, within string | |
464 | Execution of - aborted due to compilation errors. | |
58be5763 TC |
465 | ######## |
466 | # NAME octal fp with non-octal digits after the decimal point | |
467 | 01.1234567p0; | |
468 | 07.8p0; | |
469 | EXPECT | |
470 | Bareword found where operator expected at - line 2, near "8p0" | |
471 | (Missing operator before p0?) | |
472 | syntax error at - line 2, near "8p0" | |
473 | Execution of - aborted due to compilation errors. | |
474 | ######## | |
475 | # NAME binary fp with non-binary digits after the decimal point | |
476 | 0b1.10p0; | |
477 | 0b1.2p0; | |
478 | EXPECT | |
479 | Bareword found where operator expected at - line 2, near "2p0" | |
480 | (Missing operator before p0?) | |
481 | syntax error at - line 2, near "2p0" | |
482 | Execution of - aborted due to compilation errors. |