Re: Segv from new regex code when under threads.
[p5sagit/p5-mst-13.2.git] / ext / Unicode / Normalize / t / null.t
1
2 BEGIN {
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
10 BEGIN {
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
19 use strict;
20 use warnings;
21
22 use Unicode::Normalize qw(:all);
23 print "1..8\n";
24
25 print "ok 1\n";
26
27 # if $_ is not NULL-terminated, test may fail.
28
29 $_ = compose('abc');
30 print /c$/ ? "ok" : "not ok", " 2\n";
31
32 $_ = decompose('abc');
33 print /c$/ ? "ok" : "not ok", " 3\n";
34
35 $_ = reorder('abc');
36 print /c$/ ? "ok" : "not ok", " 4\n";
37
38 $_ = NFD('abc');
39 print /c$/ ? "ok" : "not ok", " 5\n";
40
41 $_ = NFC('abc');
42 print /c$/ ? "ok" : "not ok", " 6\n";
43
44 $_ = NFKD('abc');
45 print /c$/ ? "ok" : "not ok", " 7\n";
46
47 $_ = NFKC('abc');
48 print /c$/ ? "ok" : "not ok", " 8\n";
49