Skip to content

Commit

Permalink
Add tests for RT #111766
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Oct 23, 2014
1 parent 8a07d59 commit 958f352
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion S04-phasers/end.t
Expand Up @@ -4,7 +4,7 @@ use Test;
use lib 't/spec/packages';
use Test::Util;

plan 6;
plan 8;

# RT #122355
{
Expand All @@ -17,6 +17,20 @@ plan 6;
'can use &exit from END block' );
}

# RT #111766
{
{
my $a = 42;
END { is $a, 42, 'lexical lookup from END block works' };
}
{
BEGIN {
my $a = 43;
END { is $a, 43, 'lexical lookup from END block to surrounding BEGIN block works' };
}
}
}

eval_lives_ok 'my $x = 3; END { $x * $x }',
'outer lexicals are visible in END { ... } blocks';

Expand Down

0 comments on commit 958f352

Please sign in to comment.