Upgrade to File::Spec 0.85.
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / t / rel2abs2rel.t
index 34f313c..dbfb57c 100644 (file)
@@ -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" );