Upgrade to MakeMaker 6.10_07 (from makemaker.org snapshot
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / prefixify.t
CommitLineData
e0678a30 1#!/usr/bin/perl -w
2
3BEGIN {
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
13use strict;
45bc4d3a 14use Test::More;
15
16if( $^O eq 'VMS' ) {
17 plan skip_all => 'prefixify works differently on VMS';
18}
19else {
479d2113 20 plan tests => 3;
45bc4d3a 21}
479d2113 22use Config;
e0678a30 23use File::Spec;
24use ExtUtils::MM;
25
26my $mm = bless {}, 'MM';
27
28my $default = File::Spec->catdir(qw(this that));
479d2113 29
e0678a30 30$mm->prefixify('installbin', 'wibble', 'something', $default);
479d2113 31is( $mm->{INSTALLBIN}, $Config{installbin},
32 'prefixify w/defaults');
5c161494 33
479d2113 34$mm->{ARGS}{PREFIX} = 'foo';
35$mm->prefixify('installbin', 'wibble', 'something', $default);
e0678a30 36is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
479d2113 37 'prefixify w/defaults and PREFIX');
45bc4d3a 38
39{
40 undef *ExtUtils::MM_Unix::Config;
41 $ExtUtils::MM_Unix::Config{wibble} = 'C:\opt\perl\wibble';
42 $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
43
44 is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' );
45 { package ExtUtils::MM_Unix; Config->import }
46}