diff options
Diffstat (limited to 't')
-rw-r--r-- | t/eml.t | 11 | ||||
-rw-r--r-- | t/mbox_reader.t | 6 |
2 files changed, 16 insertions, 1 deletions
@@ -216,6 +216,17 @@ if ('one newline before headers') { is($eml->body, ""); } +if ('body only') { + my $str = <<EOM; +--- a/lib/PublicInbox/Eml.pm ++++ b/lib/PublicInbox/Eml.pm +@@ -122,9 +122,10 @@ sub new { +\x20 +EOM + my $eml = PublicInbox::Eml->new($str); + is($eml->body, $str, 'body-only accepted'); +} + for my $cls (@classes) { # XXX: matching E::M, but not sure about this my $s = <<EOF; Content-Type: multipart/mixed; boundary="b" diff --git a/t/mbox_reader.t b/t/mbox_reader.t index e5f57d7b..87e8f397 100644 --- a/t/mbox_reader.t +++ b/t/mbox_reader.t @@ -138,7 +138,11 @@ EOM PublicInbox::MboxReader->$m($fh, sub { push @x, $_[0]->as_string }); - is_deeply(\@x, [], "messages in invalid $m"); + if ($m =~ /\Amboxcl/) { + is_deeply(\@x, [], "messages in invalid $m"); + } else { + is_deeply(\@x, [ "\n$html" ], "body-only $m"); + } is_deeply([grep(!/^W: leftover/, @w)], [], "no extra warnings besides leftover ($m)"); } |