This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 890b5089ee
[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########
20ed5f00
FC
12# NAME Unterminated qw//
13qw/
14EXPECT
15Can't find string terminator "/" anywhere before EOF at - line 1.
16########
17# NAME Unterminated q//
18qw/
19EXPECT
20Can't find string terminator "/" anywhere before EOF at - line 1.
21########
22# NAME Unterminated ''
23'
24EXPECT
25Can't find string terminator "'" anywhere before EOF at - line 1.
26########
4407f1b8
FC
27# NAME /\N{/
28/\N{/
29EXPECT
30Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern
ca53e5d5 31Execution of - aborted due to compilation errors.
4407f1b8 32########
e660c409
FC
33# NAME map{for our *a...
34map{for our *a (1..10) {$_.=$x}}
35EXPECT
36Missing $ on loop variable at - line 1.
37########
ca8ffed2 38# NAME Missing name in "my sub"
e7d0b801 39use feature 'lexical_subs'; my sub;
ca8ffed2 40EXPECT
e7d0b801 41The lexical_subs feature is experimental at - line 1.
ca8ffed2 42Missing name in "my sub" at - line 1.
6f2d7fc9 43########
8767b1ab 44# NAME Missing name in "our sub"
e7d0b801 45use feature 'lexical_subs'; our sub;
8767b1ab 46EXPECT
e7d0b801 47The lexical_subs feature is experimental at - line 1.
8767b1ab
FC
48Missing name in "our sub" at - line 1.
49########
50# NAME Missing name in "state sub"
e7d0b801 51use 5.01; use feature 'lexical_subs';
8767b1ab
FC
52state sub;
53EXPECT
64fbf0dd 54The lexical_subs feature is experimental at - line 2.
8767b1ab
FC
55Missing name in "state sub" at - line 2.
56########
a21eb52b
FC
57# NAME my sub pack::foo
58use feature 'lexical_subs', 'state';
59my sub foo::bar;
60state sub foo::bear;
61EXPECT
62The lexical_subs feature is experimental at - line 2.
63The lexical_subs feature is experimental at - line 3.
64"my" subroutine &foo::bar can't be in a package at - line 2, near "my sub foo::bar"
65"state" subroutine &foo::bear can't be in a package at - line 3, near "state sub foo::bear"
66Execution of - aborted due to compilation errors.
67########
b2e3d01a
FC
68# NAME Integer constant overloading returning undef
69use overload;
247a7f40
FC
70BEGIN { overload::constant integer => sub {}; undef *^H }
711
72EXPECT
bb4784f0 73Constant(1) unknown at - line 3, at end of line
247a7f40
FC
74Execution of - aborted due to compilation errors.
75########
76# NAME Float constant overloading returning undef
77use overload;
78BEGIN { overload::constant float => sub {}; undef *^H }
791.1
80EXPECT
bb4784f0 81Constant(1.1) unknown at - line 3, at end of line
247a7f40
FC
82Execution of - aborted due to compilation errors.
83########
84# NAME Binary constant overloading returning undef
85use overload;
86BEGIN { overload::constant binary => sub {}; undef *^H }
870x1
88EXPECT
bb4784f0 89Constant(0x1) unknown at - line 3, at end of line
247a7f40
FC
90Execution of - aborted due to compilation errors.
91########
92# NAME String constant overloading returning undef
93use overload;
94BEGIN { overload::constant q => sub {}; undef *^H }
95'1', "1$_", tr"a"", s""a"
96EXPECT
97Constant(q) unknown at - line 3, near "'1'"
98Constant(qq) unknown at - line 3, within string
99Constant(tr) unknown at - line 3, within string
100Constant(s) unknown at - line 3, within string
101Execution of - aborted due to compilation errors.
102########
103# NAME Regexp constant overloading when *^H is undefined
104use overload;
105BEGIN { overload::constant qr => sub {}; undef *^H }
106/a/, m'a'
107EXPECT
108Constant(qq) unknown at - line 3, within pattern
109Constant(q) unknown at - line 3, within pattern
110Execution of - aborted due to compilation errors.
111########
112# NAME \N{...} when charnames fails to load but without an error
d4ead2eb 113# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
247a7f40
FC
114BEGIN { ++$_ for @INC{"charnames.pm","_charnames.pm"} }
115"\N{a}"
116EXPECT
117Constant(\N{a}) unknown at - line 2, within string
118Execution of - aborted due to compilation errors.
119########
120# NAME Integer constant overloading returning undef
121use overload;
b2e3d01a
FC
122BEGIN { overload::constant integer => sub {} }
1231
124EXPECT
bb4784f0 125Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
126Execution of - aborted due to compilation errors.
127########
128# NAME Float constant overloading returning undef
129use overload;
130BEGIN { overload::constant float => sub {} }
1311.1
132EXPECT
bb4784f0 133Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
134Execution of - aborted due to compilation errors.
135########
136# NAME Binary constant overloading returning undef
137use overload;
138BEGIN { overload::constant binary => sub {} }
1390x1
140EXPECT
bb4784f0 141Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
142Execution of - aborted due to compilation errors.
143########
144# NAME String constant overloading returning undef
145use overload;
146BEGIN { overload::constant q => sub {} }
147'1', "1$_", tr"a"", s""a"
148EXPECT
149Constant(q): Call to &{$^H{q}} did not return a defined value at - line 3, near "'1'"
150Constant(qq): Call to &{$^H{q}} did not return a defined value at - line 3, within string
151Constant(tr): Call to &{$^H{q}} did not return a defined value at - line 3, within string
152Constant(s): Call to &{$^H{q}} did not return a defined value at - line 3, within string
153Execution of - aborted due to compilation errors.
154########
155# NAME Regexp constant overloading returning undef
156use overload;
157BEGIN { overload::constant qr => sub {} }
158/a/, m'a'
159EXPECT
160Constant(qq): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
161Constant(q): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
162Execution of - aborted due to compilation errors.
163########
6f2d7fc9
FC
164# NAME Unterminated delimiter for here document
165<<"foo
166EXPECT
167Unterminated delimiter for here document at - line 1.