From: Michael G. Schwern Date: Wed, 5 Dec 2001 19:52:58 +0000 (-0500) Subject: Better abs2rel/rel2abs/canonpath tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3bb16ffcf545d079651b941b85dc2e3a4c1358f8;p=p5sagit%2Fp5-mst-13.2.git Better abs2rel/rel2abs/canonpath tests Message-ID: <20011205195257.A903@blackrider> p4raw-id: //depot/perl@13483 --- diff --git a/MANIFEST b/MANIFEST index b69db59..d528677 100644 --- a/MANIFEST +++ b/MANIFEST @@ -965,12 +965,13 @@ lib/File/Find/t/taint.t See if File::Find works with taint lib/File/Path.pm Do things like `mkdir -p' and `rm -r' lib/File/Path.t See if File::Path works lib/File/Spec.pm portable operations on file names -lib/File/Spec.t See if File::Spec works lib/File/Spec/Epoc.pm portable operations on EPOC file names lib/File/Spec/Functions.pm Function interface to File::Spec object methods -lib/File/Spec/Functions.t See if File::Spec::Functions works lib/File/Spec/Mac.pm portable operations on Mac file names lib/File/Spec/OS2.pm portable operations on OS2 file names +lib/File/Spec/t/Functions.t See if File::Spec::Functions works +lib/File/Spec/t/rel2abs2rel.t See if File::Spec->rel2abs/abs2rel works +lib/File/Spec/t/Spec.t See if File::Spec works lib/File/Spec/Unix.pm portable operations on Unix file names lib/File/Spec/VMS.pm portable operations on VMS file names lib/File/Spec/Win32.pm portable operations on Win32 file names diff --git a/lib/File/Spec/Functions.t b/lib/File/Spec/t/Functions.t old mode 100755 new mode 100644 similarity index 100% rename from lib/File/Spec/Functions.t rename to lib/File/Spec/t/Functions.t diff --git a/lib/File/Spec.t b/lib/File/Spec/t/Spec.t old mode 100755 new mode 100644 similarity index 100% rename from lib/File/Spec.t rename to lib/File/Spec/t/Spec.t diff --git a/lib/File/Spec/t/rel2abs2rel.t b/lib/File/Spec/t/rel2abs2rel.t new file mode 100644 index 0000000..69232d9 --- /dev/null +++ b/lib/File/Spec/t/rel2abs2rel.t @@ -0,0 +1,27 @@ +#!./perl -w + +# Herein we apply abs2rel, rel2abs and canonpath against various real +# world files and make sure it all actually works. + +BEGIN { + chdir 't'; + @INC = '../lib'; +} + +use Test::More tests => 5; +use File::Spec; + +# Here we make sure File::Spec can properly deal with executables. +# VMS has some trouble with these. +my $perl = File::Spec->rel2abs($^X); +is( `$^X -le "print 'ok'"`, "ok\n", '`` works' ); +is( `$perl -le "print 'ok'"`, "ok\n", 'rel2abs($^X)' ); + +$perl = File::Spec->canonpath($perl); +is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on abs executable' ); + +$perl = File::Spec->abs2rel($perl); +is( `$perl -le "print 'ok'"`, "ok\n", 'abs2rel()' ); + +$perl = File::Spec->canonpath($^X); +is( `$perl -le "print 'ok'"`, "ok\n", 'canonpath on rel executable' );