Skip to content

Commit

Permalink
Fix space-safety of path usage
Browse files Browse the repository at this point in the history
...so "foo bar/baz" is not turned into 2 separate libs
  • Loading branch information
ugexe committed Feb 24, 2018
1 parent 9fdbfbe commit 9c220e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions S10-packages/precompilation.t
Expand Up @@ -13,7 +13,7 @@ my @precomp-paths;
BEGIN my $lib-path = $?FILE.IO.parent(2).IO;
my $package-lib-prefix = $lib-path.add('packages').absolute;

my @precompiled = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--").lines;
my @precompiled = Test::Util::run( "use lib $package-lib-prefix.perl();\n" ~ q:to"--END--").lines;
for <C A B> {
my $comp-unit = $*REPO.need(CompUnit::DependencySpecification.new(:short-name("Example::$_")));
say $comp-unit.precompiled;
Expand All @@ -23,7 +23,7 @@ is @precompiled.elems, 3;
is $_, 'True' for @precompiled;

# RT #122773
my @keys = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--").lines;
my @keys = Test::Util::run( "use lib $package-lib-prefix.perl();\n" ~ q:to"--END--").lines;
use Example::A;
use Example::B;

Expand All @@ -33,7 +33,7 @@ my @keys = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--"
#?rakudo.jvm todo 'got: $["B", "C"]'
is-deeply @keys, [<A B C>], 'Diamond relationship';

my @precompiled2 = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--").lines;
my @precompiled2 = Test::Util::run( "use lib $package-lib-prefix.perl();\n" ~ q:to"--END--").lines;
for <T P D N S B G K C E F H R A U> {
my $comp-unit = $*REPO.need(CompUnit::DependencySpecification.new(:short-name("Example2::$_")));
say $comp-unit.precompiled;
Expand All @@ -43,7 +43,7 @@ is @precompiled2.elems, 15;
is $_, 'True' for @precompiled2;

# RT #123272
my @keys2 = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--").lines;
my @keys2 = Test::Util::run( "use lib $package-lib-prefix.perl();\n" ~ q:to"--END--").lines;
use v6;
use Example2::T;

Expand All @@ -61,7 +61,7 @@ is-deeply @keys2, [<C F K P>], 'Twisty maze of dependencies, all different';
#?rakudo.moar todo 'RT #122896'
{
is_run
"use lib <{$package-lib-prefix}>;\n" ~
"use lib $package-lib-prefix.perl();\n" ~
'use Example::C;
f();',
{ err => '',
Expand Down Expand Up @@ -97,7 +97,7 @@ is-deeply @keys2, [<C F K P>], 'Twisty maze of dependencies, all different';

#RT #123276
{
my @precompiled = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--").lines;
my @precompiled = Test::Util::run( "use lib $package-lib-prefix.perl();\n" ~ q:to"--END--").lines;
my $name = 'RT123276';
for "{$name}", "{$name}::B::C1", "{$name}::B::C2" -> $module-name {
Expand All @@ -110,7 +110,7 @@ is-deeply @keys2, [<C F K P>], 'Twisty maze of dependencies, all different';
is @precompiled.elems, 3, "tried to precompile all 3 modules";
is $_, 'True' for @precompiled;
my @keys = Test::Util::run( "use lib <{$package-lib-prefix}>;\n" ~ q:to"--END--").lines;
my @keys = Test::Util::run( "use lib $package-lib-prefix.perl();\n" ~ q:to"--END--").lines;
use RT123276::B::C1;
use RT123276::B::C2;
say RT123276::B::C1.^methods.grep( *.name ne "BUILDALL" )
Expand Down
2 changes: 1 addition & 1 deletion t/test-util/01-is-eqv.t
Expand Up @@ -8,7 +8,7 @@ plan 10;
sub is-eqv-fails ($code, $desc) {
my $package-lib-prefix = $?FILE.IO.parent(3).add('packages').absolute;

is_run ~ "use lib <{$package-lib-prefix}>;\n" ~
is_run ~ "use lib $package-lib-prefix.perl();\n" ~
use Test;
use Test::Util;
~ $code,
Expand Down

0 comments on commit 9c220e3

Please sign in to comment.