X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FAutoSplit.t;h=e5466a46e968c4833ab57097ffa1c14c01933b43;hb=08cdd7a3de4eb3ffe964e3e82fff3fdae9b8fabd;hp=1506e7fa0844ecfbf696118a6443be8a12dcc0aa;hpb=88e878ad9c40c8d7c9fdf3b8be066c2de02f9778;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/AutoSplit.t b/lib/AutoSplit.t index 1506e7f..e5466a4 100644 --- a/lib/AutoSplit.t +++ b/lib/AutoSplit.t @@ -7,6 +7,10 @@ my $incdir; my $lib = '"-I../lib"'; # ok on unix, nt, The extra \" are for VMS BEGIN { chdir 't' if -d 't'; + if ($^O eq 'dos') { + print "1..0 # This test is not 8.3-aware.\n"; + exit 0; + } if ($^O eq 'MacOS') { $incdir = ":auto-$$"; $lib = '-x -I::lib:'; # -x overcomes MPW $Config{startperl} anomaly @@ -67,16 +71,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 +109,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 +167,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: $@"; } } @@ -269,7 +261,7 @@ is (&*MOD*::testtesttesttest4_2, "duplicate test 4"); 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 @@ -381,7 +373,7 @@ is (&*MOD*::zombie, "You didn't use fire.", "Are our zombies undead?"); True, so don't scrub this directory. ################################################################ ## Name -Without the the timestamp check make sure that nothing happens +Without the timestamp check make sure that nothing happens ## Extra 0, 1, 1 ## Require @@ -403,7 +395,7 @@ is (&*MOD*::zombie, "You didn't use fire.", "Are our zombies still undead?"); True, so don't scrub this directory. ################################################################ ## Name -With the the timestamp check make sure that things happen (stuff gets deleted) +With the timestamp check make sure that things happen (stuff gets deleted) ## Extra 0, 1, 0 ## Get