correct output for fish shell
[p5sagit/local-lib.git] / t / de-dup.t
index 51ef4f1..f3ebe42 100644 (file)
@@ -1,32 +1,25 @@
 use strict;
 use warnings;
-use Test::More;
+use Test::More tests => 2;
+
 use File::Temp qw(tempdir);
 use Cwd;
 
-plan tests => 4;
-
 my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1);
 
 use local::lib ();
-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';
-}
+my %inc;
+my %perl5lib;
 
-local::lib->import('--self-contained', $dir);
+$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 (--self-contained)';
-    ok ! grep({ $perl5lib{$_} > 1 } keys %perl5lib), 'ENV{PERL5LIB} entries not duplicated (--self-contained)';
-}
+$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';