source: trunk/essentials/dev-lang/perl/lib/ExtUtils/t/prefixify.t@ 3951

Last change on this file since 3951 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 1.1 KB
Line 
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;
14use Test::More;
15
16if( $^O eq 'VMS' ) {
17 plan skip_all => 'prefixify works differently on VMS';
18}
19else {
20 plan tests => 3;
21}
22use ExtUtils::MakeMaker::Config;
23use File::Spec;
24use ExtUtils::MM;
25
26my $Is_Dosish = $^O =~ /^(dos|MSWin32)$/;
27
28my $mm = bless {}, 'MM';
29
30my $default = File::Spec->catdir(qw(this that));
31
32$mm->prefixify('installbin', 'wibble', 'something', $default);
33is( $mm->{INSTALLBIN}, $Config{installbin},
34 'prefixify w/defaults');
35
36$mm->{ARGS}{PREFIX} = 'foo';
37$mm->prefixify('installbin', 'wibble', 'something', $default);
38is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
39 'prefixify w/defaults and PREFIX');
40
41SKIP: {
42 skip "Test for DOSish prefixification", 1 unless $Is_Dosish;
43
44 $Config{wibble} = 'C:\opt\perl\wibble';
45 $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
46
47 is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' );
48}
Note: See TracBrowser for help on using the repository browser.