return $output;
}
-# Brackets are valid in VMS filespecs and this test puts filespecs
-# into regexes a lot.
-
-sub _escape_brackets {
- my $str = shift;
- $str =~ s/\[/\\\[/g;
- $str =~ s/\]/\\\]/g;
- return $str;
-}
-
my $i = 0;
my $dir = File::Spec->catdir($incdir, 'auto');
if ($^O eq 'VMS') {
while ($output =~ m/(\[.+\])/) {
$filespec = $1;
$replacement = VMS::Filespec::unixify($filespec);
- $filespec = _escape_brackets($filespec);
$replacement =~ s/\/$//;
- $output =~ s/$filespec/$replacement/;
+ $output =~ s/\Q$filespec\E/$replacement/;
}
}
if ($args{Tests}) {
foreach my $code (split /\n/, $args{Tests}) {
next if $code =~ /^\#/;
- $code =~ s/\[(File::Spec->catfile\(.*\))\]/[_escape_brackets($1)]/ if $^O eq 'VMS';
defined eval $code or fail(), print "# Code: $code\n# Error: $@";
}
}
is (&Just::Another::test5, "another test 5");
# very messy way to interpolate function into regexp, but it's going to be
# needed to get : for Mac filespecs
-like (&*MOD*::test6, qr!^*INC**PATHSEP**MOD*.pm \(autosplit into @{[File::Spec->catfile('*DIR*','*MOD*', 'test6.al')]}\):\d+$!);
+like (&*MOD*::test6, qr!^\Q*INC**PATHSEP**MOD*\E\.pm \(autosplit into \Q@{[File::Spec->catfile('*DIR*','*MOD*', 'test6.al')]}\E\):\d+$!);
ok (Yet::Another::AutoSplit->testtesttesttest4_1 eq "another test 4");
################################################################
## Name