Commit | Line | Data |
a9489cb0 |
1 | use strict; |
2 | use warnings; |
7487778d |
3 | use Test::More tests => 2; |
4 | |
a9489cb0 |
5 | use File::Temp qw(tempdir); |
6 | use Cwd; |
7 | |
a9489cb0 |
8 | my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1); |
9 | |
10 | use local::lib (); |
57a15df5 |
11 | |
12 | my %inc; |
13 | my %perl5lib; |
14 | |
15 | $inc{$_}-- for @INC; |
16 | $perl5lib{$_}-- for split /:/, $ENV{PERL5LIB}; |
17 | |
a9489cb0 |
18 | local::lib->import($dir); |
19 | local::lib->import($dir); |
20 | |
57a15df5 |
21 | $inc{$_}++ for @INC; |
22 | $perl5lib{$_}++ for split /:/, $ENV{PERL5LIB}; |
23 | |
24 | ok ! (grep { $inc{$_} > 1 } keys %inc), '@INC entries not duplicated'; |
25 | ok ! (grep { $perl5lib{$_} > 1 } keys %perl5lib), 'ENV{PERL5LIB} entries not duplicated'; |