Skip to content

Commit

Permalink
Tests for RT #128156
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed May 21, 2016
1 parent ca3abde commit 4e8b2e0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S10-packages/precompilation.t
Expand Up @@ -3,7 +3,7 @@ use lib 't/spec/packages';
use Test;
use Test::Util;

plan 40;
plan 41;

my @*MODULES; # needed for calling CompUnit::Repository::need directly
my $precomp-ext := $*VM.precomp-ext;
Expand Down Expand Up @@ -205,3 +205,15 @@ is-deeply @keys2, [<C D E F H K N P R S>], 'Twisty maze of dependencies, all dif
:compiler-args['-I', 't/spec/packages', '-M', 'RT127176'],
'no duplicate compilation error';
}
# RT #128156
{
# precompile it in a different process
run $*EXECUTABLE,'-I','t/spec/packages','-e','use RT128156::One;';
# trigger recompilation
my $trigger-file = 't/spec/packages/RT128156/Two.pm6'.IO;
$trigger-file.IO.spurt($trigger-file.slurp);
my $comp-unit = $*REPO.need(CompUnit::DependencySpecification.new(:short-name<RT128156::One>));
ok $comp-unit.handle.globalish-package.WHO<RT128156>.WHO<One Two Three>:exists.all,
'GLOBAL symbols exist after re-precompiled';
}
2 changes: 2 additions & 0 deletions packages/RT128156/One.pm6
@@ -0,0 +1,2 @@
class RT128156::One {};
need RT128156::Two;
2 changes: 2 additions & 0 deletions packages/RT128156/Three.pm6
@@ -0,0 +1,2 @@
# Empty
class RT128156::Three {};
3 changes: 3 additions & 0 deletions packages/RT128156/Two.pm6
@@ -0,0 +1,3 @@
need RT128156::Three;

class RT128156::Two {};

0 comments on commit 4e8b2e0

Please sign in to comment.