File: encode_bytes.t

package info (click to toggle)
libnet-idn-encode-perl 2.500-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,820 kB
  • sloc: perl: 416; makefile: 8
file content (36 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use bytes;
use strict;

use Test::More tests => 24;
use Test::NoWarnings;

use Net::IDN::Encode qw(:all);

is(to_ascii('mueller'),'mueller');
is(to_ascii('xn--mller-kva'),'xn--mller-kva');
is(to_ascii('mller'),'xn--mller-kva');

is(to_unicode('mueller'),'mueller');
is(to_unicode('xn--mller-kva'),'mller');
is(to_unicode('mller'),'mller');

is(domain_to_ascii('mueller.example.com'),'mueller.example.com');
is(domain_to_ascii('xn--mller-kva.example.com'),'xn--mller-kva.example.com');
is(domain_to_ascii('mller.example.com'),'xn--mller-kva.example.com');

is(domain_to_unicode('mueller.example.com'),'mueller.example.com');
is(domain_to_unicode('xn--mller-kva.example.com'),'mller.example.com');
is(domain_to_unicode('mller.example.com'),'mller.example.com');

is(email_to_ascii('hans@mueller.example.com'),'hans@mueller.example.com');
is(email_to_ascii('hans@xn--mller-kva.example.com'),'hans@xn--mller-kva.example.com');
is(email_to_ascii('hans@mller.example.com'),'hans@xn--mller-kva.example.com');
is(email_to_ascii(''), '');
is(email_to_ascii(undef), undef);
is(email_to_ascii('test'), 'test');

is(email_to_unicode('hans@mueller.example.com'),'hans@mueller.example.com');
is(email_to_unicode('hans@xn--mller-kva.example.com'),'hans@mller.example.com');
is(email_to_unicode(''),'');
is(email_to_unicode(undef), undef);
is(email_to_unicode('test'),'test');