File: quote-encoded.t

package info (click to toggle)
libemail-address-perl 1.908-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 380 kB
  • sloc: perl: 468; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!perl
use strict;

# This test graciously donated by Tatsuhiko Miyagawa.  All praise MIYAGAWA!

use Test::More;

plan skip_all => "Encode and Encode::MIME::Header required for these tests"
  unless eval { require Encode; require Encode::MIME::Header; 1 };

plan tests => 2;

use Email::Address;
Encode->import;
Encode::MIME::Header->import;

my $name = "\x{30c6}\x{30b9}\x{30c8}"; # "Test" in Unicode Japanese
my $mime = encode("MIME-Header", $name);

my $addr = Email::Address->new($mime => 'foo@example.com');
like $addr->format, qr/^=\?UTF-8/;
unlike $addr->format, qr/^"=\?/;