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