Remove O from the untested modules list.
[p5sagit/p5-mst-13.2.git] / t / lib / st-dump.pl
index 9b1f3d1..6ce77f0 100644 (file)
 ;# Baseline for first official release.
 ;#
 
+# NOTE THAT THIS FILE IS COPIED FROM ext/Storable/t/st-dump.pl
+# TO t/lib/st-dump.pl.  One could also play games with
+# File::Spec->updir and catdir to get the st-dump.pl in
+# ext/Storable into @INC.
+
 sub ok {
-       my ($num, $ok) = @_;
-       print "not " unless $ok;
-       print "ok $num\n";
+       my ($num, $ok, $name) = @_;
+        $num .= " - $name" if defined $name and length $name;
+       print $ok ? "ok $num\n" : "not ok $num\n";
+        $ok;
+}
+
+sub num_equal {
+       my ($num, $left, $right, $name) = @_;
+        my $ok = ((defined $left) ? $left == $right : undef);
+        unless (ok ($num, $ok, $name)) {
+          print "# Expected $right\n";
+          if (!defined $left) {
+            print "# Got undef\n";
+          } elsif ($left !~ tr/0-9//c) {
+            print "# Got $left\n";
+          } else {
+            $left =~ s/([^-a-zA-Z0-9_+])/sprintf "\\%03o", ord $1/ge;
+            print "# Got \"$left\"\n";
+          }
+        }
+        $ok;
 }
 
 package dump;