Integrate perlio:
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / t / rel2abs2rel.t
CommitLineData
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
6BEGIN {
7 chdir 't';
8 @INC = '../lib';
9}
10
f47fe535 11use Config;
12$ENV{'PATH'} = '.' . $Config{'path_sep'} . $ENV{'PATH'};
13
3bb16ffc 14use Test::More tests => 5;
15use File::Spec;
16
17# Here we make sure File::Spec can properly deal with executables.
18# VMS has some trouble with these.
19my $perl = File::Spec->rel2abs($^X);
20is( `$^X -le "print 'ok'"`, "ok\n", '`` works' );
21is( `$perl -le "print 'ok'"`, "ok\n", 'rel2abs($^X)' );
22
23$perl = File::Spec->canonpath($perl);
24is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on abs executable' );
25
26$perl = File::Spec->abs2rel($perl);
27is( `$perl -le "print 'ok'"`, "ok\n", 'abs2rel()' );
28
29$perl = File::Spec->canonpath($^X);
30is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on rel executable' );