clean up sub in INC test to hopefully avoid errors
[p5sagit/local-lib.git] / t / subroutine-in-inc.t
CommitLineData
ea7f2da2 1use strict;
2use warnings FATAL => 'all';
6e5079df 3
7487778d 4use Test::More tests => 1;
6e5079df 5
6use File::Spec;
7use Cwd;
4a3702fd 8use lib 't/lib'; use TempDir;
9use local::lib ();
6e5079df 10
11sub CODE_in_INC() {
12 return scalar grep { ref eq 'CODE' } @INC;
13}
14
4a3702fd 15my $dir = mk_temp_dir('sub-in-INC-XXXXX');
366489a7 16
4a3702fd 17my $base = CODE_in_INC;
18unshift @INC, sub { () };
19splice @INC, 3, 1, sub { () };
20push @INC, sub { () };
366489a7 21
4a3702fd 22local::lib->import($dir);
6e5079df 23
24is( CODE_in_INC, $base + 3 );