Fwd: [1113] Make @INC propagation test less fragile.

Andy Armstrong andy at hexten.net
Sun Jun 22 01:37:18 UTC 2008


I think this gets us in good shape for 3.12. If there's no dissent  
I'll make a release tomorrow.

Begin forwarded message:

> From: andy at hexten.net
> Date: 22 June 2008 02:35:07 BST
> To: tapx-commit at hexten.net
> Subject: [1113] Make @INC propagation test less fragile.
> Reply-To: tapx-dev at hexten.net
>
> Revision
> 1113
> Author
> andy
> Date
> 2008-06-22 01:35:06 +0000 (Sun, 22 Jun 2008)
> Log Message
>
> Make @INC propagation test less fragile. We're only really  
> interested in
> whether an extra sentinal value is propagated and its fussiness has
> bitten us more than once.
> Modified Paths
>
> trunk/t/compat/inc-propagation.t
> Diff
>
> Modified: trunk/t/compat/inc-propagation.t (1112 => 1113)
> --- trunk/t/compat/inc-propagation.t	2008-06-22 01:23:33 UTC (rev  
> 1112)
> +++ trunk/t/compat/inc-propagation.t	2008-06-22 01:35:06 UTC (rev  
> 1113)
> @@ -22,60 +22,28 @@
>      : ( tests => 2 )
>  );
>
> -use Data::Dumper;
>  use Test::Harness;
>
>  # Change @INC so we ensure it's preserved.
>  use lib 'wibble';
>
> -# TODO: Disabled until we find out why it's breaking on Windows. It's
> -# not strictly a TODO because it seems pretty likely that it's a  
> Windows
> -# problem rather than a problem with Test::Harness.
> -
> -# Put a stock directory near the beginning.
> -# use lib $INC[$#INC-2];
> -
> -my $inc = Data::Dumper->new( [ \@INC ] )->Terse(1)->Purity(1)->Dump;
> -my $taint_inc
> -  = Data::Dumper->new( [ [ grep { $_ ne '.' } @INC ] ] )->Terse(1)- 
> >Purity(1)
> -  ->Dump;
> -
> -# The tail of @INC is munged during core testing. We're only *really*
> -# interested in whether 'wibble' makes it anyway.
> -my $cmp_slice = $ENV{PERL_CORE} ? '[0..1]' : '';
> -
>  my $test_template = <<'END';
>  #!/usr/bin/perl %s
>
>  use Test::More tests => 2;
>
> -sub _strip_dups {
> -    my %%dups;
> -    # Drop '.' which sneaks in on some platforms
> -    my @r = grep { $_ ne '.' } grep { !$dups{$_}++ } @_;
> -    return @r%s;
> -}
> -
>  # Make sure we did something sensible with PERL5LIB
>  like $ENV{PERL5LIB}, qr{wibble};
> +ok grep { $_ eq 'wibble' } @INC;
>
> -is_deeply(
> -    [_strip_dups(@INC)],
> -    [_strip_dups(@{%s})],
> -    '@INC propagated to test'
> -) or do {
> -    diag join ",\n", _strip_dups(@INC);
> -    diag '-----------------';
> -    diag join ",\n", _strip_dups(@{%s});
> -};
>  END
>
>  open TEST, ">inc_check.t.tmp";
> -printf TEST $test_template, '', $cmp_slice, $inc, $inc;
> +printf TEST $test_template, '';
>  close TEST;
>
>  open TEST, ">inc_check_taint.t.tmp";
> -printf TEST $test_template, '-T', $cmp_slice, $taint_inc, $taint_inc;
> +printf TEST $test_template, '-T';
>  close TEST;
>  END { 1 while unlink 'inc_check_taint.t.tmp', 'inc_check.t.tmp'; }
>
> _______________________________________________
> tapx-commit mailing list
> tapx-commit at hexten.net
> http://hexten.net/mailman/listinfo/tapx-commit

-- 
Andy Armstrong, Hexten



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.hexten.net/pipermail/tapx-dev/attachments/20080622/516266b3/attachment.htm 


More information about the tapx-dev mailing list