X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fcontent_id.t;h=01ce65e5f264b4cff889b8f730943d254d936f90;hb=4db4bfa2c9178b315d2ac09cff794a4476ba1f6e;hp=c0ae6ecde27a47bd440ebd5c93a456182365400e;hpb=ccafffd2888ae58be036b35e2323c2126fa633c9;p=public-inbox.git diff --git a/t/content_id.t b/t/content_id.t index c0ae6ecd..01ce65e5 100644 --- a/t/content_id.t +++ b/t/content_id.t @@ -18,7 +18,18 @@ my $mime = Email::MIME->create( body => "hello world\n", ); -my $res = content_id($mime); -like($res, qr/\ASHA-256:[a-f0-9]{64}\z/, 'cid in format expected'); +my $orig = content_id($mime); +my $reload = content_id(Email::MIME->new($mime->as_string)); +is($orig, $reload, 'content_id matches after serialization'); + +foreach my $h (qw(From To Cc)) { + my $n = '"Quoted N\'Ame" '; + $mime->header_str_set($h, "$n"); + my $q = content_id($mime); + is($n, $mime->header($h), "content_id does not mutate $h:"); + $mime->header_str_set($h, 'Quoted N\'Ame '); + my $nq = content_id($mime); + is($nq, $q, "quotes ignored in $h:"); +} done_testing();