From 1be805e95ac882714aaa57cb34871c5e8a8e3290 Mon Sep 17 00:00:00 2001 From: "Michael G. Schwern" Date: Mon, 11 Feb 2002 07:23:02 -0500 Subject: [PATCH] Re: [PATCH] Re: Change 14566: Re: File::Spec::rel2abs2rel (?) Message-ID: <20020211172302.GD9556@blackrider> p4raw-id: //depot/perl@14654 --- lib/File/Spec/t/rel2abs2rel.t | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); -- 2.7.4