Navigation Menu

Skip to content

Commit

Permalink
[v6.d REVIEW] Improve priv is rw attr package use test
Browse files Browse the repository at this point in the history
- Use `is_run` helper instead of hand-rolling anything
- Explain what `Perl6/World` is and why we want its absence

Orig: 0c7d68f76
  • Loading branch information
zoffixznet committed Jul 15, 2018
1 parent 346f043 commit 50ad9af
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions S10-packages/use-with-class.t
Expand Up @@ -2,12 +2,12 @@ use v6;
use MONKEY-TYPING;

use lib $?FILE.IO.parent(2).add("packages");

use Test;
use Test::Util;

# L<S11/Compile-time Importation>

plan 11;
plan 10;

# test that 'use' imports class names defined in imported packages

Expand Down Expand Up @@ -54,14 +54,12 @@ ok Stupid::Class.new(), 'can instantiate object of "imported" class';
}

# RT #126302
{
my $package-lib-prefix = $?FILE.IO.parent(2).add("packages").absolute;

my $p = run :out, :err, $*EXECUTABLE, '-I', $package-lib-prefix, '-e',
'use RT126302; say "RT126302-OK"';

like $p.out.slurp(:close), /'RT126302-OK'/, 'packages compile successfully';
unlike $p.err.slurp(:close), /'src/Perl6/World.nqp'/, 'no Perl6/World.nqp in warning';
}
is_run use RT126302; say "RT126302-OK",
:compiler-args['-I', $?FILE.IO.parent(2).add("packages").absolute], {
:out(/'RT126302-OK'/),
:err{not .contains: 'src/Perl6/World.nqp'}
# "Perl6/World" is guts from Rakudo implementation and we check
# the genned warnings doesn't reference any guts
}, 'packages with private `is rw` attrs compile successfully';

# vim: ft=perl6

0 comments on commit 50ad9af

Please sign in to comment.