Commit | Line | Data |
---|---|---|
82e740b6 NC |
1 | |
2 | BEGIN { | |
65e3945f CBW |
3 | unless ('A' eq pack('U', 0x41)) { |
4 | print "1..0 # Unicode::Normalize cannot pack a Unicode code point\n"; | |
5 | exit 0; | |
6 | } | |
7 | unless (0x41 == unpack('U', 'A')) { | |
8 | print "1..0 # Unicode::Normalize cannot get a Unicode code point\n"; | |
82e740b6 NC |
9 | exit 0; |
10 | } | |
11 | } | |
12 | ||
13 | BEGIN { | |
14 | if ($ENV{PERL_CORE}) { | |
c6b7cc21 SH |
15 | chdir('t') if -d 't'; |
16 | @INC = $^O eq 'MacOS' ? qw(::lib) : qw(../lib); | |
82e740b6 NC |
17 | } |
18 | } | |
19 | ||
20 | ######################### | |
21 | ||
82e740b6 NC |
22 | use strict; |
23 | use warnings; | |
b7657688 A |
24 | BEGIN { $| = 1; print "1..48\n"; } |
25 | my $count = 0; | |
26 | sub ok ($;$) { | |
27 | my $p = my $r = shift; | |
28 | if (@_) { | |
29 | my $x = shift; | |
30 | $p = !defined $x ? !defined $r : !defined $r ? 0 : $r eq $x; | |
31 | } | |
32 | print $p ? "ok" : "not ok", ' ', ++$count, "\n"; | |
33 | } | |
34 | ||
82e740b6 | 35 | use Unicode::Normalize qw(:all); |
b7657688 A |
36 | |
37 | ok(1); | |
82e740b6 NC |
38 | |
39 | ######################### | |
40 | ||
41 | # unary op. RING-CEDILLA | |
42 | ok( "\x{30A}\x{327}" ne "\x{327}\x{30A}"); | |
43 | ok(NFD "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
44 | ok(NFC "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
45 | ok(NFKD "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
46 | ok(NFKC "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
47 | ok(FCD "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
48 | ok(FCC "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
49 | ok(reorder "\x{30A}\x{327}" eq "\x{327}\x{30A}"); | |
50 | ||
b7657688 A |
51 | # 9 |
52 | ||
82e740b6 NC |
53 | ok(prototype \&normalize,'$$'); |
54 | ok(prototype \&NFD, '$'); | |
55 | ok(prototype \&NFC, '$'); | |
56 | ok(prototype \&NFKD, '$'); | |
57 | ok(prototype \&NFKC, '$'); | |
58 | ok(prototype \&FCD, '$'); | |
59 | ok(prototype \&FCC, '$'); | |
60 | ||
61 | ok(prototype \&check, '$$'); | |
62 | ok(prototype \&checkNFD, '$'); | |
63 | ok(prototype \&checkNFC, '$'); | |
64 | ok(prototype \&checkNFKD,'$'); | |
65 | ok(prototype \&checkNFKC,'$'); | |
66 | ok(prototype \&checkFCD, '$'); | |
67 | ok(prototype \&checkFCC, '$'); | |
68 | ||
69 | ok(prototype \&decompose, '$;$'); | |
70 | ok(prototype \&reorder, '$'); | |
71 | ok(prototype \&compose, '$'); | |
72 | ok(prototype \&composeContiguous, '$'); | |
73 | ||
b7657688 A |
74 | # 27 |
75 | ||
82e740b6 NC |
76 | ok(prototype \&getCanon, '$'); |
77 | ok(prototype \&getCompat, '$'); | |
78 | ok(prototype \&getComposite, '$$'); | |
79 | ok(prototype \&getCombinClass,'$'); | |
80 | ok(prototype \&isExclusion, '$'); | |
81 | ok(prototype \&isSingleton, '$'); | |
82 | ok(prototype \&isNonStDecomp, '$'); | |
83 | ok(prototype \&isComp2nd, '$'); | |
84 | ok(prototype \&isComp_Ex, '$'); | |
82e740b6 NC |
85 | ok(prototype \&isNFD_NO, '$'); |
86 | ok(prototype \&isNFC_NO, '$'); | |
87 | ok(prototype \&isNFC_MAYBE, '$'); | |
88 | ok(prototype \&isNFKD_NO, '$'); | |
89 | ok(prototype \&isNFKC_NO, '$'); | |
90 | ok(prototype \&isNFKC_MAYBE, '$'); | |
dd8fe490 CBW |
91 | ok(prototype \&splitOnLastStarter, undef); |
92 | ok(prototype \&normalize_partial, '$$'); | |
93 | ok(prototype \&NFD_partial, '$'); | |
94 | ok(prototype \&NFC_partial, '$'); | |
95 | ok(prototype \&NFKD_partial, '$'); | |
96 | ok(prototype \&NFKC_partial, '$'); | |
97 | ||
b7657688 A |
98 | # 48 |
99 |