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