X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmid.t;h=9ad10a9912d17b3bfcfc21d25d3ad49018fe5b5c;hb=9bd675d33ad1e49bd2ebe12a1d216216e61380de;hp=223be798c47704f7a1823e6f59037ead36c840c6;hpb=00ee23808c651b7d9a9b1210871b91dd69ce4153;p=public-inbox.git
diff --git a/t/mid.t b/t/mid.t
index 223be798..9ad10a99 100644
--- a/t/mid.t
+++ b/t/mid.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2018 all contributors
+# Copyright (C) 2016-2019 all contributors
# License: AGPL-3.0+
use Test::More;
use PublicInbox::MID qw(mid_escape mids references);
@@ -25,6 +25,21 @@ is(mid_escape('foo%!@(bar)'), 'foo%25!@(bar)');
$mime->header_set('In-Reply-To', '');
is_deeply(['hello', 'world', 'weld'], references($mime->header_obj),
'references combines with In-Reply-To');
+
+ $mime->header_set('References', "\n\t");
+ $mime->header_set('In-Reply-To');
+ is_deeply(references($mime->header_obj), ['hello', 'world'],
+ 'multiline References OK');
+ $mime->header_set('References', "");
+ is_deeply(references($mime->header_obj), ['helloworld'],
+ 'drop \t in References <656C30A1EFC89F6B2082D9B6@localhost>');
+ $mime->header_set('Message-ID', "");
+ is_deeply(mids($mime->header_obj), ['helloworld'],
+ 'drop \t in Message-ID');
+
+ $mime->header_set('To', 'u@example.com');
+ $mime->header_set('References', ' ');
+ is_deeply(references($mime->header_obj), [qw(hello world)]);
}
done_testing();