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; | |
4a3702fd | 8 | use lib 't/lib'; use TempDir; |
9 | use local::lib (); | |
6e5079df | 10 | |
11 | sub CODE_in_INC() { | |
12 | return scalar grep { ref eq 'CODE' } @INC; | |
13 | } | |
14 | ||
4a3702fd | 15 | my $dir = mk_temp_dir('sub-in-INC-XXXXX'); |
366489a7 | 16 | |
4a3702fd | 17 | my $base = CODE_in_INC; |
18 | unshift @INC, sub { () }; | |
19 | splice @INC, 3, 1, sub { () }; | |
20 | push @INC, sub { () }; | |
366489a7 | 21 | |
4a3702fd | 22 | local::lib->import($dir); |
6e5079df | 23 | |
24 | is( CODE_in_INC, $base + 3 ); |