1
2BEGIN {
3    if ($ENV{PERL_CORE}) {
4        chdir('t') if -d 't';
5        @INC = $^O eq 'MacOS' ? qw(::lib) : qw(../lib);
6    }
7}
8
9#########################
10
11use strict;
12use warnings;
13
14use Unicode::Normalize qw(:all);
15print "1..24\n";
16
17print "ok 1\n";
18
19# if $_ is not NULL-terminated, test may fail.
20
21$_ = compose('abc');
22print /c$/ ? "ok" : "not ok", " 2\n";
23
24$_ = decompose('abc');
25print /c$/ ? "ok" : "not ok", " 3\n";
26
27$_ = reorder('abc');
28print /c$/ ? "ok" : "not ok", " 4\n";
29
30$_ = NFD('abc');
31print /c$/ ? "ok" : "not ok", " 5\n";
32
33$_ = NFC('abc');
34print /c$/ ? "ok" : "not ok", " 6\n";
35
36$_ = NFKD('abc');
37print /c$/ ? "ok" : "not ok", " 7\n";
38
39$_ = NFKC('abc');
40print /c$/ ? "ok" : "not ok", " 8\n";
41
42$_ = FCC('abc');
43print /c$/ ? "ok" : "not ok", " 9\n";
44
45$_ = decompose("\x{304C}abc");
46print /c$/ ? "ok" : "not ok", " 10\n";
47
48$_ = decompose("\x{304B}\x{3099}abc");
49print /c$/ ? "ok" : "not ok", " 11\n";
50
51$_ = reorder("\x{304C}abc");
52print /c$/ ? "ok" : "not ok", " 12\n";
53
54$_ = reorder("\x{304B}\x{3099}abc");
55print /c$/ ? "ok" : "not ok", " 13\n";
56
57$_ = compose("\x{304C}abc");
58print /c$/ ? "ok" : "not ok", " 14\n";
59
60$_ = compose("\x{304B}\x{3099}abc");
61print /c$/ ? "ok" : "not ok", " 15\n";
62
63$_ = NFD("\x{304C}abc");
64print /c$/ ? "ok" : "not ok", " 16\n";
65
66$_ = NFC("\x{304C}abc");
67print /c$/ ? "ok" : "not ok", " 17\n";
68
69$_ = NFKD("\x{304C}abc");
70print /c$/ ? "ok" : "not ok", " 18\n";
71
72$_ = NFKC("\x{304C}abc");
73print /c$/ ? "ok" : "not ok", " 19\n";
74
75$_ = FCC("\x{304C}abc");
76print /c$/ ? "ok" : "not ok", " 20\n";
77
78$_ = getCanon(0x100);
79print s/.$// ? "ok" : "not ok", " 21\n";
80
81$_ = getCompat(0x100);
82print s/.$// ? "ok" : "not ok", " 22\n";
83
84$_ = getCanon(0xAC00);
85print s/.$// ? "ok" : "not ok", " 23\n";
86
87$_ = getCompat(0xAC00);
88print s/.$// ? "ok" : "not ok", " 24\n";
89
90