1 # Copyright (C) 2018 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use PublicInbox::ContentId qw(content_id);
9 my $mime = Email::MIME->create(
11 From => 'a@example.com',
12 To => 'b@example.com',
13 'Content-Type' => 'text/plain',
14 Subject => 'this is a subject',
15 'Message-ID' => '<a@example.com>',
16 Date => 'Fri, 02 Oct 1993 00:00:00 +0000',
18 body => "hello world\n",
21 my $orig = content_id($mime);
22 my $reload = content_id(Email::MIME->new($mime->as_string));
23 is($orig, $reload, 'content_id matches after serialization');