X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Feml.t;h=2d8993a51075f317ce11f5cc61012d55211663d6;hb=e7d9df936d071b4a9b72d2e6096ddf1e90c1bc05;hp=ebd45c1372d8fe5be42b2c8ec9636f3adafa3b17;hpb=9dfc0b670fc634b54998c3020f173b82de1915ac;p=public-inbox.git diff --git a/t/eml.t b/t/eml.t index ebd45c13..2d8993a5 100644 --- a/t/eml.t +++ b/t/eml.t @@ -26,6 +26,8 @@ sub mime_load ($) { is($str, "hi\n", '->new modified body like Email::Simple'); is($eml->body, "hi\n", '->body works'); is($eml->as_string, "a: b\n\nhi\n", '->as_string'); + my $empty = PublicInbox::Eml->new("\n\n"); + is($empty->as_string, "\n\n", 'empty message'); } for my $cls (@classes) { @@ -214,6 +216,17 @@ if ('one newline before headers') { is($eml->body, ""); } +if ('body only') { + my $str = <new($str); + is($eml->body, $str, 'body-only accepted'); +} + for my $cls (@classes) { # XXX: matching E::M, but not sure about this my $s = <