File: test-utf8-bom.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 (18 lines) | stat: -rw-r--r-- 559 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;

use Test::More tests => 4;

use MIME::Parser;
use IO::File;

# Handle a UTF-8 BOM at start of headers

my $parser = MIME::Parser->new();
$parser->output_to_core(1);

my $entity = $parser->parse(IO::File->new('testmsgs/utf8-bom-at-start.msg'));
is ($entity->mime_type, 'multipart/mixed', 'Got expected MIME type');
is ($entity->parts, 2, 'There are two parts');
is ($entity->parts(0)->mime_type, 'text/plain', 'First part is text/plain');
is ($entity->parts(1)->mime_type, 'application/msword', 'Second part is application/msword');