X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FFile%2FSpec%2Ft%2Frel2abs2rel.t;h=dbfb57ca5aa03b5f81669e54d25368a281f8fce8;hb=e021ab8eb33165472d1025d41b9f78226e0d90c7;hp=34f313c4dccfb5c892d9bededb44fcb7d68e8aa3;hpb=7996736c5ecb6da6273386229ce113837049152c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/File/Spec/t/rel2abs2rel.t b/lib/File/Spec/t/rel2abs2rel.t index 34f313c..dbfb57c 100644 --- a/lib/File/Spec/t/rel2abs2rel.t +++ b/lib/File/Spec/t/rel2abs2rel.t @@ -1,12 +1,13 @@ -#!./perl -w +#!/usr/bin/perl -w -# Herein we apply abs2rel, rel2abs and canonpath against various real -# world files and make sure it all actually works. +# Here we make sure File::Spec can properly deal with executables. +# VMS has some trouble with these. + +use Test::More (-x $^X + ? (tests => 5) + : (skip_all => "Can't find an executable file") + ); -BEGIN { - chdir 't'; - @INC = '../lib'; -} BEGIN { # Set up a tiny script file open(F, ">rel2abs2rel$$.pl") or die "Can't open rel2abs2rel$$.pl file for script -- $!\n"; @@ -20,7 +21,6 @@ END { use Config; -use Test::More tests => 5; use File::Spec; # Change 'perl' to './perl' so the shell doesn't go looking through PATH. @@ -50,19 +50,19 @@ sub sayok{ return $output; } -# Here we make sure File::Spec can properly deal with executables. -# VMS has some trouble with these. +print "Checking manipulations of \$^X=$^X\n"; + my $perl = safe_rel($^X); -is( sayok($perl), "ok\n", '`` works' ); +is( sayok($perl), "ok\n", "`$perl rel2abs2rel$$.pl` works" ); $perl = File::Spec->rel2abs($^X); -is( sayok($perl), "ok\n", '`` works' ); +is( sayok($perl), "ok\n", "`$perl rel2abs2rel$$.pl` works" ); $perl = File::Spec->canonpath($perl); -is( sayok($perl), "ok\n", 'rel2abs($^X)' ); +is( sayok($perl), "ok\n", "canonpath(rel2abs($^X)) = $perl" ); $perl = safe_rel(File::Spec->abs2rel($perl)); -is( sayok($perl), "ok\n", 'canonpath on abs executable' ); +is( sayok($perl), "ok\n", "safe_rel(abs2rel(canonpath(rel2abs($^X)))) = $perl" ); $perl = safe_rel(File::Spec->canonpath($^X)); -is(sayok($perl), "ok\n", 'canonpath on rel executable' ); +is( sayok($perl), "ok\n", "safe_rel(canonpath($^X)) = $perl" );