Commit | Line | Data |
---|---|---|
ea7f2da2 | 1 | use strict; |
2 | use warnings FATAL => 'all'; | |
6e5079df | 3 | |
7487778d | 4 | use Test::More tests => 1; |
6e5079df | 5 | |
6 | use File::Spec; | |
7 | use Cwd; | |
8 | use File::Temp qw/ tempdir /; | |
6e5079df | 9 | my $base; |
10 | ||
11 | sub CODE_in_INC() { | |
12 | return scalar grep { ref eq 'CODE' } @INC; | |
13 | } | |
14 | ||
366489a7 | 15 | my $dir; |
16 | ||
6e5079df | 17 | BEGIN { |
18 | $base = CODE_in_INC; | |
19 | unshift @INC, sub { }; | |
20 | splice @INC, 3, 1, sub { }; | |
21 | push @INC, sub { }; | |
366489a7 | 22 | |
23 | $dir = tempdir( DIR => Cwd::abs_path('t'), CLEANUP => 1 ); | |
6e5079df | 24 | } |
25 | ||
26 | use local::lib( $dir ); | |
27 | ||
28 | is( CODE_in_INC, $base + 3 ); |