xref: /openbsd-src/gnu/usr.bin/perl/t/lib/croak/toke (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1__END__
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########
12# NAME Missing name in "my sub"
13use feature 'lexical_subs'; my sub;
14EXPECT
15The lexical_subs feature is experimental at - line 1.
16Missing name in "my sub" at - line 1.
17########
18# NAME Missing name in "our sub"
19use feature 'lexical_subs'; our sub;
20EXPECT
21The lexical_subs feature is experimental at - line 1.
22Missing name in "our sub" at - line 1.
23########
24# NAME Missing name in "state sub"
25use 5.01; use feature 'lexical_subs';
26state sub;
27EXPECT
28The lexical_subs feature is experimental at - line 2.
29Missing name in "state sub" at - line 2.
30########
31# NAME Integer constant overloading returning undef
32use overload;
33BEGIN { overload::constant integer => sub {}; undef *^H }
341
35EXPECT
36Constant(1) unknown at - line 3, at end of line
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
44Constant(1.1) unknown at - line 3, at end of line
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
52Constant(0x1) unknown at - line 3, at end of line
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
76# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
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;
85BEGIN { overload::constant integer => sub {} }
861
87EXPECT
88Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
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
96Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
97Execution of - aborted due to compilation errors.
98########
99# NAME Binary constant overloading returning undef
100use overload;
101BEGIN { overload::constant binary => sub {} }
1020x1
103EXPECT
104Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
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########
127# NAME Unterminated delimiter for here document
128<<"foo
129EXPECT
130Unterminated delimiter for here document at - line 1.
131