New improved test harness
[p5sagit/p5-mst-13.2.git] / lib / Dumpvalue.pm
index 94b6aa6..c8282cf 100644 (file)
@@ -1,6 +1,7 @@
 use 5.005_64;                  # for (defined ref) and $#$v and our
 package Dumpvalue;
 use strict;
+our $VERSION = '1.00';
 our(%address, $stab, @stab, %stab, %subs);
 
 # translate control chars to ^X - Randal Schwartz
@@ -227,9 +228,9 @@ sub unwrap {
     if ($self->{compactDump} && !grep(ref $_, @{$v})) {
       if ($#$v >= 0) {
        $short = $sp . "0..$#{$v}  " .
-         join(" ",
-              map {$self->stringify($_)} @{$v}[0..$tArrayDepth])
-           . "$shortmore";
+         join(" ", 
+              map {exists $v->[$_] ? $self->stringify($v->[$_]) : "empty"} ($[..$tArrayDepth)
+             ) . "$shortmore";
       } else {
        $short = $sp . "empty array";
       }
@@ -238,7 +239,11 @@ sub unwrap {
     for my $num ($[ .. $tArrayDepth) {
       return if $DB::signal and $self->{stopDbSignal};
       print "$sp$num  ";
-      $self->DumpElem($v->[$num], $s);
+      if (exists $v->[$num]) {
+        $self->DumpElem($v->[$num], $s);
+      } else {
+       print "empty slot\n";
+      }
     }
     print "$sp  empty array\n" unless @$v;
     print "$sp$more" if defined $more ;
@@ -404,7 +409,8 @@ sub dumpvars {
     next if @vars && !grep( matchvar($key, $_), @vars );
     if ($self->{usageOnly}) {
       $self->globUsage(\$val, $key)
-       unless $package eq 'Dumpvalue' and $key eq 'stab';
+       if ($package ne 'Dumpvalue' or $key ne 'stab')
+          and ref(\$val) eq 'GLOB';
     } else {
       $self->dumpglob($package, 0,$key, $val);
     }