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);
23print "1..8\n";
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
50