File: de-dup.t

package info (click to toggle)
liblocal-lib-perl 2.000014-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 308 kB
  • ctags: 72
  • sloc: perl: 727; makefile: 22
file content (25 lines) | stat: -rw-r--r-- 583 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use warnings;
use Test::More tests => 2;

use File::Temp qw(tempdir);
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);

$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';