File: ticket-52924.t

package info (click to toggle)
libmime-tools-perl 5.515-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,612 kB
  • sloc: perl: 6,349; makefile: 8
file content (23 lines) | stat: -rw-r--r-- 580 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;

use Test::More tests => 2;

# Ticket 52924: Ensure we add < > arround Content-ID header contents.

use MIME::Entity;

my $bare_id = '123456789.09876@host.example.com';

my $e = MIME::Entity->build(
	Path => "./testin/short.txt",
	Id   => $bare_id,
);
is( $e->head->mime_attr('content-id'), "<$bare_id>", '<> added around bare Id value when creating');

undef $e;
$e = MIME::Entity->build(
	Path => "./testin/short.txt",
	Id   => "<$bare_id>",
);
is( $e->head->mime_attr('content-id'), "<$bare_id>", '<> not added around Id value when already present');