From: Michael G. Schwern Date: Mon, 11 Feb 2002 12:23:02 +0000 (-0500) Subject: Re: [PATCH] Re: Change 14566: Re: File::Spec::rel2abs2rel (?) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1be805e95ac882714aaa57cb34871c5e8a8e3290;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] Re: Change 14566: Re: File::Spec::rel2abs2rel (?) Message-ID: <20020211172302.GD9556@blackrider> p4raw-id: //depot/perl@14654 --- diff --git a/lib/File/Spec/t/rel2abs2rel.t b/lib/File/Spec/t/rel2abs2rel.t index 72d25a8..1e868f3 100644 --- a/lib/File/Spec/t/rel2abs2rel.t +++ b/lib/File/Spec/t/rel2abs2rel.t @@ -10,12 +10,14 @@ BEGIN { use Config; -# Make sure when we run `perl` we get this perl -$ENV{'PATH'} = '.' . $Config{'path_sep'} . $ENV{'PATH'}; - use Test::More tests => 5; use File::Spec; +# Change 'perl' to './perl' so the shell doesn't go looking through PATH. +sub safe_rel { + return File::Spec->catfile(File::Spec->curdir, $_[0]); +} + # Here we make sure File::Spec can properly deal with executables. # VMS has some trouble with these. my $perl = File::Spec->rel2abs($^X); @@ -25,7 +27,7 @@ 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); +$perl = safe_rel($perl); is( `$perl -le "print 'ok'"`, "ok\n", 'abs2rel()' ); $perl = File::Spec->canonpath($^X);