File: encode_w-prefix.t

package info (click to toggle)
libidna-punycode-perl 1.100%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 112 kB
  • sloc: perl: 62; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (3)
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
use utf8;
use strict;

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

use IDNA::Punycode;

is(encode_punycode('faerber'),'faerber');
is(encode_punycode('xn--frber-gra'),'xn--frber-gra');
is(encode_punycode('färber'),'xn--frber-gra');
is(encode_punycode('中央大学'),'xn--fiq80yua78t');

is(decode_punycode('faerber'),'faerber');
is(decode_punycode('xn--frber-gra'),'färber');
is(decode_punycode('färber'),'färber');
is(decode_punycode('xn--fiq80yua78t'),'中央大学');

idn_prefix('yo--'); # yo, man

is(encode_punycode('faerber'),'faerber');
is(encode_punycode('yo--frber-gra'),'yo--frber-gra');
is(encode_punycode('färber'),'yo--frber-gra');
is(encode_punycode('中央大学'),'yo--fiq80yua78t');

is(decode_punycode('faerber'),'faerber');
is(decode_punycode('yo--frber-gra'),'färber');
is(decode_punycode('färber'),'färber');
is(decode_punycode('yo--fiq80yua78t'),'中央大学');