pod2html: try to be EOL agnostic.
[p5sagit/p5-mst-13.2.git] / lib / AutoSplit.t
index e913f34..7cc680e 100644 (file)
@@ -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,14 +109,13 @@ 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/;
      }
   }
 
   # test n+1
-  is ($output, $args{Get}, "Output from autosplit()ing $args{Name}");
+  cmp_ok ($output, 'eq', $args{Get}, "Output from autosplit()ing $args{Name}");
 
   if ($args{Files}) {
     $args{Files} =~ s!/!:!gs if $^O eq 'MacOS';
@@ -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: $@";
     }
   }
@@ -315,7 +307,7 @@ AutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD*)
 is (&*MOD*::obsolete, 0);
 is (&*MOD*::obsolete, 1);
 ## Sleep
-2
+4
 ## SameAgain
 True, so don't scrub this directory.
 IIRC DOS FAT filesystems have only 2 second granularity.
@@ -346,7 +338,7 @@ AutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD*)
 is (&*MOD*::skeleton, "bones", "skeleton");
 eval {&*MOD*::gonner}; ok ($@ =~ m!^Can't locate auto/*MOD*/gonner.al in \@INC!, "Check &*MOD*::gonner is now a gonner") or print "# \$\@='$@'\n";
 ## Sleep
-2
+4
 ## SameAgain
 True, so don't scrub this directory.
 ################################################################
@@ -376,12 +368,12 @@ AutoSplitting *INC**PATHSEP**MOD*.pm (*DIR**PATHSEP**MOD*)
 is (&*MOD*::ghost, "bump");
 is (&*MOD*::zombie, "You didn't use fire.", "Are our zombies undead?");
 ## Sleep
-2
+4
 ## SameAgain
 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
@@ -398,12 +390,12 @@ Without the the timestamp check make sure that nothing happens
 is (&*MOD*::ghoul, "wail", "still haunted");
 is (&*MOD*::zombie, "You didn't use fire.", "Are our zombies still undead?");
 ## Sleep
-2
+4
 ## SameAgain
 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