X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmid.t;h=e2d8dcbf6ccd26be888e71b42b3c4ed02e84a705;hb=8ffed15abbec68463ff3f3105d6651c8a4b5d813;hp=7005101ff3f89b8d9506c4dd46477437ce096ef5;hpb=a5c812fb9d39adcf6ae7e63c15177ac3ce0cadfb;p=public-inbox.git
diff --git a/t/mid.t b/t/mid.t
index 7005101f..e2d8dcbf 100644
--- a/t/mid.t
+++ b/t/mid.t
@@ -1,7 +1,8 @@
-# Copyright (C) 2016-2019 all contributors
+# Copyright (C) 2016-2021 all contributors
# License: AGPL-3.0+
use strict;
use Test::More;
+use PublicInbox::Eml;
use PublicInbox::MID qw(mid_escape mids references mids_for_index id_compress);
is(mid_escape('foo!@(bar)'), 'foo!@(bar)');
@@ -15,10 +16,8 @@ like(id_compress('foo%bar@wtf'), qr/\A[a-f0-9]{40}\z/,
is(id_compress('foobar-wtf'), 'foobar-wtf', 'regular ID not compressed');
{
- use Email::MIME;
- my $mime = Email::MIME->create;
+ my $mime = PublicInbox::Eml->new("Message-ID: \n\n");
$mime->header_set('X-Alt-Message-ID', '');
- $mime->header_set('Message-Id', '');
is_deeply(['mid-1@a'], mids($mime->header_obj), 'mids in common case');
$mime->header_set('Message-Id', '', '');
is_deeply(['mid-1@a', 'mid-2@b'], mids($mime->header_obj), '2 mids');