enable warnings locally, rather than globally
[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;
8use File::Temp qw/ tempdir /;
6e5079df 9my $base;
10
11sub CODE_in_INC() {
12 return scalar grep { ref eq 'CODE' } @INC;
13}
14
366489a7 15my $dir;
16
6e5079df 17BEGIN {
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
26use local::lib( $dir );
27
28is( CODE_in_INC, $base + 3 );