From: Graham Knop Date: Mon, 23 Dec 2013 02:17:50 +0000 (-0500) Subject: fix de-dup test X-Git-Tag: v2.000_000~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57a15df5bd88e32a50b5a5f79983556424c32a2c;p=p5sagit%2Flocal-lib.git fix de-dup test --- diff --git a/t/de-dup.t b/t/de-dup.t index 56b508c..f3ebe42 100644 --- a/t/de-dup.t +++ b/t/de-dup.t @@ -8,13 +8,18 @@ use Cwd; my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1); use local::lib (); + +my %inc; +my %perl5lib; + +$inc{$_}-- for @INC; +$perl5lib{$_}-- for split /:/, $ENV{PERL5LIB}; + local::lib->import($dir); local::lib->import($dir); -{ - my (%inc, %perl5lib); - map { $inc{$_}++ } @INC; - map { $perl5lib{$_} } split /:/, $ENV{PERL5LIB}; - ok ! grep({ $inc{$_} > 1 } keys %inc), '@INC entries not duplicated'; - ok ! grep({ $perl5lib{$_} > 1 } keys %perl5lib), 'ENV{PERL5LIB} entries not duplicated'; -} +$inc{$_}++ for @INC; +$perl5lib{$_}++ for split /:/, $ENV{PERL5LIB}; + +ok ! (grep { $inc{$_} > 1 } keys %inc), '@INC entries not duplicated'; +ok ! (grep { $perl5lib{$_} > 1 } keys %perl5lib), 'ENV{PERL5LIB} entries not duplicated';