Commit | Line | Data |
9ce33444 |
1 | #!/usr/bin/perl -Tw |
7a5004db |
2 | |
3 | BEGIN { |
39234879 |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't' if -d 't'; |
6 | @INC = '../lib'; |
7 | } |
f6d6199c |
8 | else { |
9ce33444 |
9 | # ./lib is there so t/lib can be seen even after we chdir. |
10 | unshift @INC, 't/lib', './lib'; |
f6d6199c |
11 | } |
7a5004db |
12 | } |
39234879 |
13 | chdir 't'; |
7a5004db |
14 | |
a67d7a01 |
15 | use Test::More tests => 5; |
7a5004db |
16 | |
39234879 |
17 | BEGIN { |
18 | # non-core tests will have blib in their path. We remove it |
19 | # and just use the one in lib/. |
20 | unless( $ENV{PERL_CORE} ) { |
21 | @INC = grep !/blib/, @INC; |
22 | unshift @INC, '../lib'; |
23 | } |
24 | } |
25 | |
26 | my @blib_paths = grep /blib/, @INC; |
7a5004db |
27 | is( @blib_paths, 0, 'No blib dirs yet in @INC' ); |
28 | |
29 | use_ok( 'ExtUtils::testlib' ); |
30 | |
31 | @blib_paths = grep { /blib/ } @INC; |
32 | is( @blib_paths, 2, 'ExtUtils::testlib added two @INC dirs!' ); |
9ce33444 |
33 | ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths), |
34 | ' and theyre absolute'); |
a67d7a01 |
35 | |
36 | eval { eval "# @INC"; }; |
37 | is( $@, '', '@INC is not tainted' ); |