Upgrade to Unicode::Normalize 0.12.
[p5sagit/p5-mst-13.2.git] / ext / Unicode / Normalize / t / func.t
CommitLineData
ac5ea531 1# Before `make install' is performed this script should be runnable with
2# `make test'. After `make install' it should work as `perl test.pl'
3
4#########################
5
6use Test;
7use strict;
8use warnings;
9BEGIN { plan tests => 6 };
10use Unicode::Normalize qw(:all);
11ok(1); # If we made it this far, we're ok.
12
13#########################
14
15print getCombinClass( 0) == 0
16 && getCombinClass( 768) == 230
17 && getCombinClass(1809) == 36
18# && getCombinClass(119143) == 1
19 ? "ok" : "not ok", " 2\n";
20
21print ! defined getCanon( 0)
22 && ! defined getCanon(41)
23 && getCanon(0x00C0) eq pack('U*', 0x0041, 0x0300)
24 && getCanon(0x00EF) eq pack('U*', 0x0069, 0x0308)
25 && getCanon(0x304C) eq pack('U*', 0x304B, 0x3099)
26 && getCanon(0x1EA4) eq pack('U*', 0x0041, 0x0302, 0x0301)
2a204b45 27 && getCanon(0x1F82) eq "\x{03B1}\x{0313}\x{0300}\x{0345}"
ac5ea531 28 && getCanon(0x1FAF) eq pack('U*', 0x03A9, 0x0314, 0x0342, 0x0345)
29 && getCanon(0xAC00) eq pack('U*', 0x1100, 0x1161)
30 && getCanon(0xAE00) eq pack('U*', 0x1100, 0x1173, 0x11AF)
31 && ! defined getCanon(0x212C)
32 && ! defined getCanon(0x3243)
33 && getCanon(0xFA2D) eq pack('U*', 0x9DB4)
34 ? "ok" : "not ok", " 3\n";
35
36print ! defined getCompat( 0)
37 && ! defined getCompat(41)
38 && getCompat(0x00C0) eq pack('U*', 0x0041, 0x0300)
39 && getCompat(0x00EF) eq pack('U*', 0x0069, 0x0308)
40 && getCompat(0x304C) eq pack('U*', 0x304B, 0x3099)
41 && getCompat(0x1EA4) eq pack('U*', 0x0041, 0x0302, 0x0301)
2a204b45 42 && getCompat(0x1F82) eq pack('U*', 0x03B1, 0x0313, 0x0300, 0x0345)
ac5ea531 43 && getCompat(0x1FAF) eq pack('U*', 0x03A9, 0x0314, 0x0342, 0x0345)
44 && getCompat(0x212C) eq pack('U*', 0x0042)
45 && getCompat(0x3243) eq pack('U*', 0x0028, 0x81F3, 0x0029)
46 && getCompat(0xAC00) eq pack('U*', 0x1100, 0x1161)
47 && getCompat(0xAE00) eq pack('U*', 0x1100, 0x1173, 0x11AF)
48 && getCompat(0xFA2D) eq pack('U*', 0x9DB4)
49 ? "ok" : "not ok", " 4\n";
50
2a204b45 51print ! defined getComposite( 0, 0)
52 && ! defined getComposite( 0, 41)
53 && ! defined getComposite(41, 0)
54 && ! defined getComposite(41, 41)
55 && ! defined getComposite(12, 0x0300)
56 && ! defined getComposite(0x0055, 0xFF00)
57 && 0x00C0 == getComposite(0x0041, 0x0300)
ac5ea531 58 && 0x00D9 == getComposite(0x0055, 0x0300)
59 && 0x1E14 == getComposite(0x0112, 0x0300)
60 && 0xAC00 == getComposite(0x1100, 0x1161)
61 && 0xADF8 == getComposite(0x1100, 0x1173)
62 && ! getComposite(0x1100, 0x11AF)
63 && ! getComposite(0x1173, 0x11AF)
64 && 0xAE00 == getComposite(0xADF8, 0x11AF)
65 ? "ok" : "not ok", " 5\n";
66
2a204b45 67print ! isExclusion( 0)
68 && ! isExclusion(41)
69 && isExclusion(2392)
70 && isExclusion(3907)
71 && isExclusion(64334)
ac5ea531 72 ? "ok" : "not ok", " 6\n";
2a204b45 73