This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Correct ‘"my" variable "&f::b"...’ message
[perl5.git] / t / lib / croak / toke
index 9020452..9c8dd54 100644 (file)
@@ -9,11 +9,26 @@ eval "s//<<foo/e"; die $@
 EXPECT
 Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
 ########
+# NAME Unterminated qw//
+qw/
+EXPECT
+Can't find string terminator "/" anywhere before EOF at - line 1.
+########
+# NAME Unterminated q//
+qw/
+EXPECT
+Can't find string terminator "/" anywhere before EOF at - line 1.
+########
+# NAME Unterminated ''
+'
+EXPECT
+Can't find string terminator "'" anywhere before EOF at - line 1.
+########
 # NAME /\N{/
 /\N{/
 EXPECT
 Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern
-Execution of -e aborted due to compilation errors.
+Execution of - aborted due to compilation errors.
 ########
 # NAME Missing name in "my sub"
 use feature 'lexical_subs'; my sub;
@@ -34,6 +49,17 @@ EXPECT
 The lexical_subs feature is experimental at - line 2.
 Missing name in "state sub" at - line 2.
 ########
+# NAME my sub pack::foo
+use feature 'lexical_subs', 'state';
+my sub foo::bar;
+state sub foo::bear;
+EXPECT
+The lexical_subs feature is experimental at - line 2.
+The lexical_subs feature is experimental at - line 3.
+"my" subroutine &foo::bar can't be in a package at - line 2, near "my sub foo::bar"
+"state" subroutine &foo::bear can't be in a package at - line 3, near "state sub foo::bear"
+Execution of - aborted due to compilation errors.
+########
 # NAME Integer constant overloading returning undef
 use overload;
 BEGIN { overload::constant integer => sub {}; undef *^H }