about summary refs log tree commit homepage
path: root/t/eml.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-26 10:35:51 +0000
committerEric Wong <e@80x24.org>2021-10-26 17:43:52 +0000
commit584721cf9c98beabce9b779faafa1eabb5c24de6 (patch)
tree1d5c0978fc275bcc2f1b7712904e28ff844fa3e0 /t/eml.t
parent273090c96e3b5c214605decf5a755546116cc9bd (diff)
downloadpublic-inbox-584721cf9c98beabce9b779faafa1eabb5c24de6.tar.gz
This easily allows us to treat "git diff" output as header-less
"messages" for commands such as "lei p2q".
Diffstat (limited to 't/eml.t')
-rw-r--r--t/eml.t11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/eml.t b/t/eml.t
index 0cf48f22..2d8993a5 100644
--- a/t/eml.t
+++ b/t/eml.t
@@ -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"