summaryrefslogtreecommitdiff
path: root/regress/message/basic_io.pl
diff options
context:
space:
mode:
authorfukachan <fukachan>2006-01-24 14:11:57 +0000
committerfukachan <fukachan>2006-01-24 14:11:57 +0000
commitcb20aeab8199ebfd15215ff88a138aeeb0a056b3 (patch)
tree0d815002947fdeccc22bf1a177d63c35f9f1a537 /regress/message/basic_io.pl
parentde94d5c57bba58b6b76a4c04289817adc11e3a8f (diff)
downloadfml8-cb20aeab8199ebfd15215ff88a138aeeb0a056b3.tar.gz
fml8-cb20aeab8199ebfd15215ff88a138aeeb0a056b3.tar.bz2
fml8-cb20aeab8199ebfd15215ff88a138aeeb0a056b3.zip
overhaul based on FML::Test::Utils.
Diffstat (limited to 'regress/message/basic_io.pl')
-rwxr-xr-xregress/message/basic_io.pl26
1 files changed, 21 insertions, 5 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;