| Line | |
|---|
| 1 | #!/usr/bin/perl -Tw
|
|---|
| 2 |
|
|---|
| 3 | BEGIN {
|
|---|
| 4 | if( $ENV{PERL_CORE} ) {
|
|---|
| 5 | chdir 't' if -d 't';
|
|---|
| 6 | @INC = '../lib';
|
|---|
| 7 | }
|
|---|
| 8 | else {
|
|---|
| 9 | # ./lib is there so t/lib can be seen even after we chdir.
|
|---|
| 10 | unshift @INC, 't/lib', './lib';
|
|---|
| 11 | }
|
|---|
| 12 | }
|
|---|
| 13 | chdir 't';
|
|---|
| 14 |
|
|---|
| 15 | use Test::More tests => 5;
|
|---|
| 16 |
|
|---|
| 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;
|
|---|
| 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!' );
|
|---|
| 33 | ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths),
|
|---|
| 34 | ' and theyre absolute');
|
|---|
| 35 |
|
|---|
| 36 | eval { eval "# @INC"; };
|
|---|
| 37 | is( $@, '', '@INC is not tainted' );
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.