This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldiag: Clarify an entry
[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########
ca8ffed2 12# NAME Missing name in "my sub"
e7d0b801 13use feature 'lexical_subs'; my sub;
ca8ffed2 14EXPECT
e7d0b801 15The lexical_subs feature is experimental at - line 1.
ca8ffed2 16Missing name in "my sub" at - line 1.
6f2d7fc9 17########
8767b1ab 18# NAME Missing name in "our sub"
e7d0b801 19use feature 'lexical_subs'; our sub;
8767b1ab 20EXPECT
e7d0b801 21The lexical_subs feature is experimental at - line 1.
8767b1ab
FC
22Missing name in "our sub" at - line 1.
23########
24# NAME Missing name in "state sub"
e7d0b801 25use 5.01; use feature 'lexical_subs';
8767b1ab
FC
26state sub;
27EXPECT
64fbf0dd 28The lexical_subs feature is experimental at - line 2.
8767b1ab
FC
29Missing name in "state sub" at - line 2.
30########
b2e3d01a
FC
31# NAME Integer constant overloading returning undef
32use overload;
247a7f40
FC
33BEGIN { overload::constant integer => sub {}; undef *^H }
341
35EXPECT
bb4784f0 36Constant(1) unknown at - line 3, at end of line
247a7f40
FC
37Execution of - aborted due to compilation errors.
38########
39# NAME Float constant overloading returning undef
40use overload;
41BEGIN { overload::constant float => sub {}; undef *^H }
421.1
43EXPECT
bb4784f0 44Constant(1.1) unknown at - line 3, at end of line
247a7f40
FC
45Execution of - aborted due to compilation errors.
46########
47# NAME Binary constant overloading returning undef
48use overload;
49BEGIN { overload::constant binary => sub {}; undef *^H }
500x1
51EXPECT
bb4784f0 52Constant(0x1) unknown at - line 3, at end of line
247a7f40
FC
53Execution of - aborted due to compilation errors.
54########
55# NAME String constant overloading returning undef
56use overload;
57BEGIN { overload::constant q => sub {}; undef *^H }
58'1', "1$_", tr"a"", s""a"
59EXPECT
60Constant(q) unknown at - line 3, near "'1'"
61Constant(qq) unknown at - line 3, within string
62Constant(tr) unknown at - line 3, within string
63Constant(s) unknown at - line 3, within string
64Execution of - aborted due to compilation errors.
65########
66# NAME Regexp constant overloading when *^H is undefined
67use overload;
68BEGIN { overload::constant qr => sub {}; undef *^H }
69/a/, m'a'
70EXPECT
71Constant(qq) unknown at - line 3, within pattern
72Constant(q) unknown at - line 3, within pattern
73Execution of - aborted due to compilation errors.
74########
75# NAME \N{...} when charnames fails to load but without an error
d4ead2eb 76# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
247a7f40
FC
77BEGIN { ++$_ for @INC{"charnames.pm","_charnames.pm"} }
78"\N{a}"
79EXPECT
80Constant(\N{a}) unknown at - line 2, within string
81Execution of - aborted due to compilation errors.
82########
83# NAME Integer constant overloading returning undef
84use overload;
b2e3d01a
FC
85BEGIN { overload::constant integer => sub {} }
861
87EXPECT
bb4784f0 88Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
89Execution of - aborted due to compilation errors.
90########
91# NAME Float constant overloading returning undef
92use overload;
93BEGIN { overload::constant float => sub {} }
941.1
95EXPECT
bb4784f0 96Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
97Execution of - aborted due to compilation errors.
98########
99# NAME Binary constant overloading returning undef
100use overload;
101BEGIN { overload::constant binary => sub {} }
1020x1
103EXPECT
bb4784f0 104Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
b2e3d01a
FC
105Execution of - aborted due to compilation errors.
106########
107# NAME String constant overloading returning undef
108use overload;
109BEGIN { overload::constant q => sub {} }
110'1', "1$_", tr"a"", s""a"
111EXPECT
112Constant(q): Call to &{$^H{q}} did not return a defined value at - line 3, near "'1'"
113Constant(qq): Call to &{$^H{q}} did not return a defined value at - line 3, within string
114Constant(tr): Call to &{$^H{q}} did not return a defined value at - line 3, within string
115Constant(s): Call to &{$^H{q}} did not return a defined value at - line 3, within string
116Execution of - aborted due to compilation errors.
117########
118# NAME Regexp constant overloading returning undef
119use overload;
120BEGIN { overload::constant qr => sub {} }
121/a/, m'a'
122EXPECT
123Constant(qq): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
124Constant(q): Call to &{$^H{qr}} did not return a defined value at - line 3, within pattern
125Execution of - aborted due to compilation errors.
126########
6f2d7fc9
FC
127# NAME Unterminated delimiter for here document
128<<"foo
129EXPECT
130Unterminated delimiter for here document at - line 1.