82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / testlib.t
CommitLineData
9ce33444 1#!/usr/bin/perl -Tw
7a5004db 2
3BEGIN {
b78fd716 4 # ./lib is there so t/lib can be seen even after we chdir.
5 unshift @INC, 't/lib', './lib';
7a5004db 6}
39234879 7chdir 't';
7a5004db 8
a67d7a01 9use Test::More tests => 5;
7a5004db 10
39234879 11BEGIN {
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
20my @blib_paths = grep /blib/, @INC;
7a5004db 21is( @blib_paths, 0, 'No blib dirs yet in @INC' );
22
23use_ok( 'ExtUtils::testlib' );
24
25@blib_paths = grep { /blib/ } @INC;
26is( @blib_paths, 2, 'ExtUtils::testlib added two @INC dirs!' );
9ce33444 27ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths),
28 ' and theyre absolute');
a67d7a01 29
30eval { eval "# @INC"; };
31is( $@, '', '@INC is not tainted' );