In TestInit.pm, merge two substitutions into one.
authorNicholas Clark <nick@ccl4.org>
Sun, 19 Jun 2011 16:13:38 +0000 (18:13 +0200)
committerNicholas Clark <nick@ccl4.org>
Wed, 22 Jun 2011 20:41:10 +0000 (22:41 +0200)
Both are intended to transform ./perl into ../../perl, one for forward slashes,
one for backslashes.

TestInit.pm

index a113554..7c24da4 100644 (file)
@@ -18,7 +18,7 @@
 
 package TestInit;
 
-$VERSION = 1.03;
+$VERSION = 1.04;
 
 # Let tests know they're running in the perl core.  Useful for modules
 # which live dual lives on CPAN.
@@ -64,8 +64,7 @@ if (-f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext') {
        chdir $1 or die "Can't chdir '$1': $!";
        new_inc(@up_2_t);
        set_opt(@up_2_t);
-       $^X =~ s!^\./!../../!;
-       $^X =~ s!^\.\\!..\\..\\!;
+       $^X =~ s!^\.([/\\])!..$1..$1!;
     } else {
        chdir 't' or die "Can't chdir 't': $!";
        new_inc('../lib');