Remove O from the untested modules list.
[p5sagit/p5-mst-13.2.git] / t / lib / st-dump.pl
index b9f64a4..6ce77f0 100644 (file)
@@ -1,19 +1,42 @@
-;# $Id: dump.pl,v 0.7 2000/08/03 22:04:45 ram Exp $
+;# $Id: dump.pl,v 1.0 2000/09/01 19:40:41 ram Exp $
 ;#
 ;#  Copyright (c) 1995-2000, Raphael Manfredi
 ;#  
-;#  You may redistribute only under the terms of the Artistic License,
-;#  as specified in the README file that comes with the distribution.
+;#  You may redistribute only under the same terms as Perl 5, as specified
+;#  in the README file that comes with the distribution.
 ;#
 ;# $Log: dump.pl,v $
-;# Revision 0.7  2000/08/03 22:04:45  ram
-;# Baseline for second beta release.
+;# Revision 1.0  2000/09/01 19:40:41  ram
+;# 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;