xref: /openbsd/gnu/usr.bin/perl/t/lib/croak/toke (revision cecf84d4)
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 /\N{/
13/\N{/
14EXPECT
15Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern
16Execution of - aborted due to compilation errors.
17########
18# NAME Missing name in "my sub"
19use feature 'lexical_subs'; my sub;
20EXPECT
21The lexical_subs feature is experimental at - line 1.
22Missing name in "my sub" at - line 1.
23########
24# NAME Missing name in "our sub"
25use feature 'lexical_subs'; our sub;
26EXPECT
27The lexical_subs feature is experimental at - line 1.
28Missing name in "our sub" at - line 1.
29########
30# NAME Missing name in "state sub"
31use 5.01; use feature 'lexical_subs';
32state sub;
33EXPECT
34The lexical_subs feature is experimental at - line 2.
35Missing name in "state sub" at - line 2.
36########
37# NAME Integer constant overloading returning undef
38use overload;
39BEGIN { overload::constant integer => sub {}; undef *^H }
401
41EXPECT
42Constant(1) unknown at - line 3, at end of line
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
50Constant(1.1) unknown at - line 3, at end of line
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
58Constant(0x1) unknown at - line 3, at end of line
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
82# SKIP ? exists $ENV{PERL_UNICODE} ? "Unreliable under some PERL_UNICODE settings" : 0
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;
91BEGIN { overload::constant integer => sub {} }
921
93EXPECT
94Constant(1): Call to &{$^H{integer}} did not return a defined value at - line 3, at end of line
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
102Constant(1.1): Call to &{$^H{float}} did not return a defined value at - line 3, at end of line
103Execution of - aborted due to compilation errors.
104########
105# NAME Binary constant overloading returning undef
106use overload;
107BEGIN { overload::constant binary => sub {} }
1080x1
109EXPECT
110Constant(0x1): Call to &{$^H{binary}} did not return a defined value at - line 3, at end of line
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########
133# NAME Unterminated delimiter for here document
134<<"foo
135EXPECT
136Unterminated delimiter for here document at - line 1.
137########
138# NAME Unterminated qw//
139qw/
140EXPECT
141Can't find string terminator "/" anywhere before EOF at - line 1.
142########
143# NAME Unterminated q//
144qw/
145EXPECT
146Can't find string terminator "/" anywhere before EOF at - line 1.
147########
148# NAME Unterminated ''
149'
150EXPECT
151Can't find string terminator "'" anywhere before EOF at - line 1.
152