summaryrefslogtreecommitdiff
path: root/regress/message
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-04-13 04:34:07 +0000
committerfukachan <fukachan>2001-04-13 04:34:07 +0000
commit0f51d63d5c7d419ec0041e0595a23456dee27d6e (patch)
tree0afd61954fe483bc6f566b8057c4716c160f947a /regress/message
parenta6bd836e9640e346fbe9d2cdabc1e1977c2d9f4d (diff)
downloadfml8-0f51d63d5c7d419ec0041e0595a23456dee27d6e.tar.gz
fml8-0f51d63d5c7d419ec0041e0595a23456dee27d6e.tar.bz2
fml8-0f51d63d5c7d419ec0041e0595a23456dee27d6e.zip
test mode (not test_mode by default) which shows ok / fail
Diffstat (limited to 'regress/message')
-rwxr-xr-xregress/message/basic_io.pl21
1 files changed, 13 insertions, 8 deletions
diff --git a/regress/message/basic_io.pl b/regress/message/basic_io.pl
index 51c138ac..be6731ff 100755
--- a/regress/message/basic_io.pl
+++ b/regress/message/basic_io.pl
@@ -5,7 +5,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: basic_io.pl,v 1.2 2001/04/08 05:05:10 fukachan Exp $
+# $FML: basic_io.pl,v 1.3 2001/04/13 04:03:11 fukachan Exp $
#
use strict;
@@ -13,6 +13,8 @@ use Carp;
use lib qw(../../cpan/lib);
use Mail::Message;
+my $test_mode = $ENV{'test_mode'} ? 1 : 0;
+
my $tmp = "/tmp/buf$$";
for my $f (@ARGV) {
@@ -24,20 +26,23 @@ for my $f (@ARGV) {
$obj->print($wh);
$wh->close;
- print "\n<< $f\n";
-
- # use Data::Dumper; print Dumper( $obj );
-
- my $h = $obj->get_data_type_list;
- for (@$h) { print " ", $_, "\n";}
+ unless ($test_mode) {
+ print "\n<< $f\n";
+ my $h = $obj->get_data_type_list;
+ for (@$h) { print " ", $_, "\n";}
+ print "\n";
+ }
- print "\n";
use IO::Handle;
my $fd = new IO::Handle;
my $i = 0;
open($fd, "diff -ub $f $tmp|");
while (<$fd>) { $i++; print " ", $_ if $i > 3;}
close($fd);
+
+ print "$f ";
+ print $i ? "fail" : "ok";
+ print "\n";
}
unlink $tmp;