From 50ad9af5b423eeaac8919caa4a675e84e5223d1c Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 14 Jul 2018 21:49:29 -0400 Subject: [PATCH] [v6.d REVIEW] Improve priv is rw attr package use test - Use `is_run` helper instead of hand-rolling anything - Explain what `Perl6/World` is and why we want its absence Orig: https://github.com/perl6/roast/commit/0c7d68f76 --- S10-packages/use-with-class.t | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/S10-packages/use-with-class.t b/S10-packages/use-with-class.t index 179eb0f3d2..c289df6c39 100644 --- a/S10-packages/use-with-class.t +++ b/S10-packages/use-with-class.t @@ -2,12 +2,12 @@ use v6; use MONKEY-TYPING; use lib $?FILE.IO.parent(2).add("packages"); - use Test; +use Test::Util; # L -plan 11; +plan 10; # test that 'use' imports class names defined in imported packages @@ -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