Commit | Line | Data |
3bb16ffc |
1 | #!./perl -w |
2 | |
3 | # Herein we apply abs2rel, rel2abs and canonpath against various real |
4 | # world files and make sure it all actually works. |
5 | |
6 | BEGIN { |
7 | chdir 't'; |
8 | @INC = '../lib'; |
9 | } |
10 | |
f47fe535 |
11 | use Config; |
b15a22ab |
12 | |
13 | # Make sure when we run `perl` we get this perl |
f47fe535 |
14 | $ENV{'PATH'} = '.' . $Config{'path_sep'} . $ENV{'PATH'}; |
15 | |
3bb16ffc |
16 | use Test::More tests => 5; |
17 | use File::Spec; |
18 | |
19 | # Here we make sure File::Spec can properly deal with executables. |
20 | # VMS has some trouble with these. |
21 | my $perl = File::Spec->rel2abs($^X); |
22 | is( `$^X -le "print 'ok'"`, "ok\n", '`` works' ); |
23 | is( `$perl -le "print 'ok'"`, "ok\n", 'rel2abs($^X)' ); |
24 | |
25 | $perl = File::Spec->canonpath($perl); |
26 | is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on abs executable' ); |
27 | |
28 | $perl = File::Spec->abs2rel($perl); |
29 | is( `$perl -le "print 'ok'"`, "ok\n", 'abs2rel()' ); |
30 | |
31 | $perl = File::Spec->canonpath($^X); |
32 | is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on rel executable' ); |