This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c:newMYSUB: disable stub optimisation
[perl5.git] / TestInit.pm
index e7609da..16eb318 100644 (file)
@@ -27,6 +27,8 @@ $VERSION = 1.04;
 # http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-07/msg00154.html
 $ENV{PERL_CORE} = $^X;
 
+$0 =~ s/\.dp$//; # for the test.deparse make target
+
 sub import {
     my $self = shift;
     my @up_2_t = ('../../lib', '../../t');
@@ -60,12 +62,12 @@ sub import {
            # We're being run from the top level. Try to change directory, and
            # set things up correctly. This is a 90% solution, but for
            # hand-running tests, that's good enough
-           if ($0 =~ s!^((?:ext|dist|cpan)[\\/][^\\/]+)[\//](.*\.t)$!$2!) {
+           if ($0 =~ s!^((?:ext|dist|cpan)[\\/][^\\/]+)[\\/](.*\.t)$!$2!) {
                # Looks like a test in ext.
                $chdir = $1;
                @INC = @up_2_t;
                $setopt = 1;
-               $^X =~ s!^\.([/\\])!..$1..$1!;
+               $^X =~ s!^\.([\\/])!..$1..$1!;
            } else {
                $chdir = 't';
                @INC = '../lib';
@@ -110,5 +112,4 @@ sub import {
     push @INC, '.' unless ${^TAINT};
 }
 
-$0 =~ s/\.dp$//; # for the test.deparse make target
 1;