Commit | Line | Data |
e0678a30 |
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; |
45bc4d3a |
14 | use Test::More; |
15 | |
16 | if( $^O eq 'VMS' ) { |
17 | plan skip_all => 'prefixify works differently on VMS'; |
18 | } |
19 | else { |
479d2113 |
20 | plan tests => 3; |
45bc4d3a |
21 | } |
479d2113 |
22 | use Config; |
e0678a30 |
23 | use File::Spec; |
24 | use ExtUtils::MM; |
25 | |
26 | my $mm = bless {}, 'MM'; |
27 | |
28 | my $default = File::Spec->catdir(qw(this that)); |
479d2113 |
29 | |
e0678a30 |
30 | $mm->prefixify('installbin', 'wibble', 'something', $default); |
479d2113 |
31 | is( $mm->{INSTALLBIN}, $Config{installbin}, |
32 | 'prefixify w/defaults'); |
5c161494 |
33 | |
479d2113 |
34 | $mm->{ARGS}{PREFIX} = 'foo'; |
35 | $mm->prefixify('installbin', 'wibble', 'something', $default); |
e0678a30 |
36 | is( $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 | } |