This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix a (back)slash bug in a regex, added with the regex itself.
authorNicholas Clark <nick@ccl4.org>
Mon, 20 Jun 2011 08:56:48 +0000 (10:56 +0200)
committerNicholas Clark <nick@ccl4.org>
Wed, 22 Jun 2011 20:41:23 +0000 (22:41 +0200)
8fcfece7bab67639 added code to TestInit to set the CWD and @INC for tests in
ext. However, the regex used to distinguish where a test was had one forward
slash where a backslash should have been, hence the intended Win32 support
would not work. I'm assuming that no-one has noticed this because no-one has
tried to run tests from the command line on Win32 directly, or if they have
they always use forward slashes in their pathnames.

TestInit.pm

index e7609da..814c99c 100644 (file)
@@ -60,7 +60,7 @@ 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;