xref: /openbsd-src/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/testlib.t (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1#!/usr/bin/perl -Tw
2
3BEGIN {
4    # ./lib is there so t/lib can be seen even after we chdir.
5    unshift @INC, 't/lib', './lib';
6}
7chdir 't';
8
9use Test::More tests => 5;
10
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;
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!' );
27ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths),
28                    '  and theyre absolute');
29
30eval { eval "# @INC"; };
31is( $@, '',     '@INC is not tainted' );
32