if ($record->{inner_file}) {
push @lines, $record->{fh}->getline;
push @lines, $record->{fh}->getline;
+ chomp $lines[0];
+ chomp $lines[1];
} else {
@lines = split( "\n", $record->{text}, -1 );
}
}
if ( !( $lines[ 0 ] =~ m/^From / ) ) {
unshift @lines, "From unknown $date";
- }
+ }
+ print $lines[0]."\n";
print map { s/^(>*From )/>$1/; $_."\n" } @lines[ 1 .. $#lines ];
if ($record->{inner_file}) {
my $fh = $record->{fh};
- print <$fh>;
+ print $_ while (<$fh>);
}
}
exit 0;
# -*- mode: cperl;-*-
-use Test::More tests => 3;
+use Test::More tests => 6;
use warnings;
use strict;
ok($mech->content() =~ qr/\<title\>\#1.+Submitting a bug/i,
'Title of bug is submitting a bug');
+$mech->get_ok('http://localhost:'.$port.'/?bug=1;mbox=yes',
+ 'Page received ok');
+ok($mech->content() =~ qr/Subject: Submitting a bug/i,
+ 'Subject of bug maibox is right');
+ok($mech->content() =~ qr/^From /m,
+ 'Starts with a From appropriately');
+
+
# Other tests for bugs in the page should be added here eventually