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; |
12 | $ENV{'PATH'} = '.' . $Config{'path_sep'} . $ENV{'PATH'}; |
13 | |
3bb16ffc |
14 | use Test::More tests => 5; |
15 | use File::Spec; |
16 | |
17 | # Here we make sure File::Spec can properly deal with executables. |
18 | # VMS has some trouble with these. |
19 | my $perl = File::Spec->rel2abs($^X); |
20 | is( `$^X -le "print 'ok'"`, "ok\n", '`` works' ); |
21 | is( `$perl -le "print 'ok'"`, "ok\n", 'rel2abs($^X)' ); |
22 | |
23 | $perl = File::Spec->canonpath($perl); |
24 | is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on abs executable' ); |
25 | |
26 | $perl = File::Spec->abs2rel($perl); |
27 | is( `$perl -le "print 'ok'"`, "ok\n", 'abs2rel()' ); |
28 | |
29 | $perl = File::Spec->canonpath($^X); |
30 | is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on rel executable' ); |