Skip to content

Commit

Permalink
Add test for GH 2684
Browse files Browse the repository at this point in the history
  • Loading branch information
Altai-man committed May 20, 2019
1 parent b65646c commit df6cab3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion S10-packages/precompilation.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;

plan 49;
plan 51;

my @*MODULES; # needed for calling CompUnit::Repository::need directly

Expand Down Expand Up @@ -289,3 +289,16 @@ with make-temp-dir() -> $dir {
'no funny business with precompiled string strands (\qq[$_])';
}
}
# GH 2684
with make-temp-dir() -> $dir {
$dir.add('GH2684.pm6').spurt:
my $x; BEGIN { $x = -> { "foo".subst(/o/, 'a', :g) } }; $x();
;
for ^2 {
is_run 'use lib \qq[$dir.absolute().perl()]; use GH2684;',
{:out(''), :err(''), :0status},
"Dyncomp lexical lookup plays well with BEGIN blocks ($_)";
}
}

0 comments on commit df6cab3

Please sign in to comment.