MM_Unix.pm : work around File::Find problem on VMS
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / prefixify.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't' if -d 't';
6         @INC = ('../lib', 'lib');
7     }
8     else {
9         unshift @INC, 't/lib';
10     }
11 }
12
13 use strict;
14 use Test::More;
15
16 if( $^O eq 'VMS' ) {
17     plan skip_all => 'prefixify works differently on VMS';
18 }
19 else {
20     plan tests => 2;
21 }
22 use File::Spec;
23 use ExtUtils::MM;
24
25 my $mm = bless {}, 'MM';
26
27 my $default = File::Spec->catdir(qw(this that));
28 $mm->prefixify('installbin', 'wibble', 'something', $default);
29
30 is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
31                                             'prefixify w/defaults');
32
33 {
34     undef *ExtUtils::MM_Unix::Config;
35     $ExtUtils::MM_Unix::Config{wibble} = 'C:\opt\perl\wibble';
36     $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
37
38     is( $mm->{WIBBLE}, 'C:\yarrow\wibble',  'prefixify Win32 paths' );
39     { package ExtUtils::MM_Unix;  Config->import }
40 }