82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / testlib.t
1 #!/usr/bin/perl -Tw
2
3 BEGIN {
4     # ./lib is there so t/lib can be seen even after we chdir.
5     unshift @INC, 't/lib', './lib';
6 }
7 chdir 't';
8
9 use Test::More tests => 5;
10
11 BEGIN { 
12     # non-core tests will have blib in their path.  We remove it
13     # and just use the one in lib/.
14     unless( $ENV{PERL_CORE} ) {
15         @INC = grep !/blib/, @INC;
16         unshift @INC, '../lib';
17     }
18 }
19
20 my @blib_paths = grep /blib/, @INC;
21 is( @blib_paths, 0, 'No blib dirs yet in @INC' );
22
23 use_ok( 'ExtUtils::testlib' );
24
25 @blib_paths = grep { /blib/ } @INC;
26 is( @blib_paths, 2, 'ExtUtils::testlib added two @INC dirs!' );
27 ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths),
28                     '  and theyre absolute');
29
30 eval { eval "# @INC"; };
31 is( $@, '',     '@INC is not tainted' );