diff options
| -rwxr-xr-x | regress/message/basic_io.pl | 26 | ||||
| -rwxr-xr-x | regress/message/bounce.pl | 7 |
2 files changed, 26 insertions, 7 deletions
diff --git a/regress/message/basic_io.pl b/regress/message/basic_io.pl index 1acb19d4..87d3fd38 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.5 2002/04/18 14:18:09 fukachan Exp $ +# $FML: basic_io.pl,v 1.6 2004/12/08 07:26:15 fukachan Exp $ # use strict; @@ -13,6 +13,12 @@ use Carp; use lib qw(../../cpan/lib); use Mail::Message; +my $debug = $ENV{ debug } ? 1 : 0; + +use FML::Test::Utils; +my $tool = new FML::Test::Utils; +$tool->set_title("message basic io test"); + my $test_mode = $ENV{'test_mode'} ? 1 : 0; my $tmp = "/tmp/buf$$"; @@ -37,12 +43,22 @@ for my $f (@ARGV) { my $fd = new IO::Handle; my $i = 0; open($fd, "diff -ub $f $tmp|"); - while (<$fd>) { $i++; print " ", $_ if $i > 3;} + while (<$fd>) { + $i++; + if ($debug) { + print " ", $_ if $i > 3; + } + } close($fd); - print "$f "; - print $i ? "fail" : "ok"; - print "\n"; + use File::Basename; + $tool->set_title(basename($f)); + if ($i) { + $tool->print_error(); + } + else { + $tool->print_ok(); + } } unlink $tmp; diff --git a/regress/message/bounce.pl b/regress/message/bounce.pl index 7a97949a..a3767d1c 100755 --- a/regress/message/bounce.pl +++ b/regress/message/bounce.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: bounce.pl,v 1.8 2001/07/30 23:00:06 fukachan Exp $ +# $FML: bounce.pl,v 1.9 2005/07/27 12:16:20 fukachan Exp $ # use strict; @@ -13,6 +13,9 @@ use Carp; use lib qw(../../cpan/lib); use Mail::Message; +use FML::Test::Utils; +my $tool = new FML::Test::Utils; + for my $f (@ARGV) { print "// check $f\n" if $ENV{'debug'}; my $fh = new FileHandle $f; @@ -23,7 +26,7 @@ for my $f (@ARGV) { my $bouncer = new Mail::Bounce; $bouncer->analyze( $msg ); print "\n--- result (debug)\n\n" if $ENV{'debug'}; - printf "# %-20s ... %s\n", $f, ($bouncer->address_list ? "ok" : "fail"); + printf "# %-40s ... %s\n", $f, ($bouncer->address_list ? "ok" : "fail"); if ($ENV{'dump'}) { eval qq{ require Data::Dumper; Data::Dumper->import();}; |
