This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "[perl #79908] Stop sub inlining from breaking closures"
[perl5.git] / t / lib / croak / toke
CommitLineData
ca8ffed2 1__END__
5af08aed
FC
2# NAME Unterminated here-doc in string eval
3eval "<<foo"; die $@
4EXPECT
5Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
6########
7# NAME Unterminated here-doc in s/// string eval
8eval "s//<<foo/e"; die $@
9EXPECT
10Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
11########
4407f1b8
FC
12# NAME /\N{/
13/\N{/
14EXPECT
15Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern
ca53e5d5 16Execution of - aborted due to compilation errors.
4407f1b8 17########
ca8ffed2 18# NAME Missing name in "my sub"
e7d0b801 19use feature 'lexical_subs'; my sub;
ca8ffed2 20EXPECT
e7d0b801 21The lexical_subs feature is experimental at - line 1.
ca8ffed2 22Missing name in "my sub" at - line 1.
6f2d7fc9 23########
8767b1ab 24# NAME Missing name in "our sub"
e7d0b801 25use feature 'lexical_subs'; our sub;
8767b1ab 26EXPECT
e7d0b801 27The lexical_subs feature is experimental at - line 1.
8767b1ab
FC
28Missing name in "our sub" at - line 1.
29########
30# NAME Missing name in "state sub"
e7d0b801 31use 5.01; use feature 'lexical_subs';
8767b1ab
FC
32state sub;
33EXPECT
64fbf0dd 34The lexical_subs feature is experimental at - line 2.
8767b1ab
FC
35Missing name in "state sub" at - line 2.
36########
b2e3d01a
FC
37# NAME Integer constant overloading returning undef
38use overload;
247a7f40
FC
39BEGIN { overload::constant integer => sub {}; undef *^H }
401
41EXPECT
bb4784f0 42Constant(1) unknown at - line 3, at end of line
247a7f40
FC
43Execution of - aborted due to compilation errors.
44########
45# NAME Float constant overloading returning undef
46use overload;
47BEGIN { overload::constant float => sub {}; undef *^H }
481.1
49EXPECT
bb4784f0 50Constant(1.1) unknown at - line 3, at end of line
247a7f40
FC
51Execution of - aborted due to compilation errors.
52########
53# NAME Binary constant overloading returning undef
54use overload;
55BEGIN { overload::constant binary => sub {}; undef *^H }
560x1
57EXPECT
bb4784f0 58Constant(0x1) unknown at - line 3, at end of line
247a7f40
FC
59Execution of - aborted due to compilation errors.
60########
61# NAME String constant overloading returning undef
62use overload;
63BEGIN { overload::constant q => sub {}; undef *^H }
64'1', "1$_", tr"a"", s""a"
65EXPECT
66Constant(q) unknown at - line 3, near "'1'"
67Constant(qq) unknown at - line 3, within string
68Constant(tr) unknown at - line 3, within string
69Constant(s) unknown at - line 3, within string
70Execution of - aborted due to compilation errors.
71########
72# NAME Regexp constant overloading when *^H is undefined
73use overload;
74BEGIN { overload::constant qr => sub {}; undef *^H }
75/a/, m'a'
76EXPECT
77Constant(qq) unknown at - line 3, within pattern
78Constant(q) unknown at - line 3, within pattern
79Execution of - aborted due to compilation errors.
80########
81# NAME \N{...} when charnames fails to load but without an error
d4ead2eb 82# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
247a7f40
FC
83BEGIN { ++$_ for @INC{"charnames.pm","_charnames.pm"} }
84"\N{a}"
85EXPECT
86Constant(\N{a}) unknown at - line 2, within string
87Execution of - aborted due to compilation errors.
88########
89# NAME Integer constant overloading returning undef
90use overload;
b2e3d01a
FC
91BEGIN { overload::constant integer => sub {} }
921
93EXPECT
bb4784f0 94Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
95Execution of - aborted due to compilation errors.
96########
97# NAME Float constant overloading returning undef
98use overload;
99BEGIN { overload::constant float => sub {} }
1001.1
101EXPECT
bb4784f0 102Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
103Execution of - aborted due to compilation errors.
104########
105# NAME Binary constant overloading returning undef
106use overload;
107BEGIN { overload::constant binary => sub {} }
1080x1
109EXPECT
bb4784f0 110Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
111Execution of - aborted due to compilation errors.
112########
113# NAME String constant overloading returning undef
114use overload;
115BEGIN { overload::constant q => sub {} }
116'1', "1$_", tr"a"", s""a"
117EXPECT
118Constant(q): Call to &{$^H{q}} did not return a defined value at - line 3, near "'1'"
119Constant(qq): Call to &{$^H{q}} did not return a defined value at - line 3, within string
120Constant(tr): Call to &{$^H{q}} did not return a defined value at - line 3, within string
121Constant(s): Call to &{$^H{q}} did not return a defined value at - line 3, within string
122Execution of - aborted due to compilation errors.
123########
124# NAME Regexp constant overloading returning undef
125use overload;
126BEGIN { overload::constant qr => sub {} }
127/a/, m'a'
128EXPECT
129Constant(qq): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
130Constant(q): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
131Execution of - aborted due to compilation errors.
132########
6f2d7fc9
FC
133# NAME Unterminated delimiter for here document
134<<"foo
135EXPECT
136Unterminated delimiter for here document at - line 1.