This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: no sigaction, no si fields
[perl5.git] / cpan / Unicode-Normalize / t / proto.t
CommitLineData
82e740b6
NC
1
2BEGIN {
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
13BEGIN {
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
22use strict;
23use warnings;
b7657688
A
24BEGIN { $| = 1; print "1..48\n"; }
25my $count = 0;
26sub 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 35use Unicode::Normalize qw(:all);
b7657688
A
36
37ok(1);
82e740b6
NC
38
39#########################
40
41# unary op. RING-CEDILLA
42ok( "\x{30A}\x{327}" ne "\x{327}\x{30A}");
43ok(NFD "\x{30A}\x{327}" eq "\x{327}\x{30A}");
44ok(NFC "\x{30A}\x{327}" eq "\x{327}\x{30A}");
45ok(NFKD "\x{30A}\x{327}" eq "\x{327}\x{30A}");
46ok(NFKC "\x{30A}\x{327}" eq "\x{327}\x{30A}");
47ok(FCD "\x{30A}\x{327}" eq "\x{327}\x{30A}");
48ok(FCC "\x{30A}\x{327}" eq "\x{327}\x{30A}");
49ok(reorder "\x{30A}\x{327}" eq "\x{327}\x{30A}");
50
b7657688
A
51# 9
52
82e740b6
NC
53ok(prototype \&normalize,'$$');
54ok(prototype \&NFD, '$');
55ok(prototype \&NFC, '$');
56ok(prototype \&NFKD, '$');
57ok(prototype \&NFKC, '$');
58ok(prototype \&FCD, '$');
59ok(prototype \&FCC, '$');
60
61ok(prototype \&check, '$$');
62ok(prototype \&checkNFD, '$');
63ok(prototype \&checkNFC, '$');
64ok(prototype \&checkNFKD,'$');
65ok(prototype \&checkNFKC,'$');
66ok(prototype \&checkFCD, '$');
67ok(prototype \&checkFCC, '$');
68
69ok(prototype \&decompose, '$;$');
70ok(prototype \&reorder, '$');
71ok(prototype \&compose, '$');
72ok(prototype \&composeContiguous, '$');
73
b7657688
A
74# 27
75
82e740b6
NC
76ok(prototype \&getCanon, '$');
77ok(prototype \&getCompat, '$');
78ok(prototype \&getComposite, '$$');
79ok(prototype \&getCombinClass,'$');
80ok(prototype \&isExclusion, '$');
81ok(prototype \&isSingleton, '$');
82ok(prototype \&isNonStDecomp, '$');
83ok(prototype \&isComp2nd, '$');
84ok(prototype \&isComp_Ex, '$');
82e740b6
NC
85ok(prototype \&isNFD_NO, '$');
86ok(prototype \&isNFC_NO, '$');
87ok(prototype \&isNFC_MAYBE, '$');
88ok(prototype \&isNFKD_NO, '$');
89ok(prototype \&isNFKC_NO, '$');
90ok(prototype \&isNFKC_MAYBE, '$');
dd8fe490
CBW
91ok(prototype \&splitOnLastStarter, undef);
92ok(prototype \&normalize_partial, '$$');
93ok(prototype \&NFD_partial, '$');
94ok(prototype \&NFC_partial, '$');
95ok(prototype \&NFKD_partial, '$');
96ok(prototype \&NFKC_partial, '$');
97
b7657688
A
98# 48
99