From: Craig A. Berry Date: Fri, 2 Nov 2001 00:03:52 +0000 (-0600) Subject: AutoSplit.t clean-up for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=18e548ce1d77b525add551f80ef335f852cf9389;p=p5sagit%2Fp5-mst-13.2.git AutoSplit.t clean-up for VMS Message-Id: <5.1.0.14.2.20011101235844.02cd4e50@exchi01> p4raw-id: //depot/perl@12806 --- diff --git a/lib/AutoSplit.t b/lib/AutoSplit.t index e913f34..dbd003d 100644 --- a/lib/AutoSplit.t +++ b/lib/AutoSplit.t @@ -67,16 +67,6 @@ sub split_a_file { 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') { @@ -115,9 +105,8 @@ foreach (@tests) { 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/; } } @@ -174,7 +163,6 @@ foreach (@tests) { 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: $@"; } }