Skip to content

Commit 38fe8a0

Browse files
author
Father Chrysostomos
committed
[perl #123367] Test my sub defined in BEGIN{eval}
This accidentally started working in v5.21.6-197-g0f94cb1.
1 parent 1d6c37f commit 38fe8a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/op/lexsub.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BEGIN {
77
*bar::is = *is;
88
*bar::like = *like;
99
}
10-
plan 151;
10+
plan 152;
1111

1212
# -------------------- Errors with feature disabled -------------------- #
1313

@@ -760,6 +760,10 @@ not_lexical11();
760760
my sub x;
761761
eval 'sub x {3}';
762762
is x, 3, 'my sub defined inside eval';
763+
764+
my sub z;
765+
BEGIN { eval 'sub z {4}' }
766+
is z, 4, 'my sub defined in BEGIN { eval "..." }';
763767
}
764768

765769
{

0 commit comments

Comments
 (0)