Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for RT #109322
  • Loading branch information
usev6 committed Jun 18, 2015
1 parent 3192739 commit 0867f11
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion S06-advanced/lexical-subs.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 11;
plan 13;

{
sub f() {
Expand Down Expand Up @@ -68,4 +68,35 @@ plan 11;
throws-like 'sub a { }; sub a { }', X::Redeclaration;
}

# RT #109322
{
my $rt109322;
sub foo ($a, $f) {
if $f {
foo('z', 0);
}
given $a {
$rt109322 ~= $a;
$rt109322 ~= $_;
}
}
foo('x', 1);
is $rt109322, 'zzxx', 'no lexical weirdness from blocks inside re-entrant subs (1)';

$rt109322 = '';
sub bar ($a, $f) {
if $f {
bar('z', 0);
}
{
$_ = $a;
$rt109322 ~= $a;
$rt109322 ~= $_;
}
};
bar('x', 1);
#?rakudo.moar todo 'RT #109322'
is $rt109322, 'zzxx', 'no lexical weirdness from blocks inside re-entrant subs (2)';
}

# vim: ft=perl6 :

0 comments on commit 0867f11

Please sign in to comment.