4 print "1..0 # Unicode::Normalize not ported to EBCDIC\n";
10 if ($ENV{PERL_CORE}) {
16 #########################
21 BEGIN { plan tests => 18 };
22 use Unicode::Normalize qw(normalize);
23 ok(1); # If we made it this far, we're ok.
25 our $IsEBCDIC = ord("A") != 0x41;
29 ? pack('U*', map utf8::unicode_to_native($_), @_)
35 ? map(utf8::native_to_unicode($_), unpack 'U*', shift)
36 : unpack('U*', shift);
39 #########################
41 ok(normalize('C', ""), "");
42 ok(normalize('D', ""), "");
45 join " ", map sprintf("%04X", $_),
46 _unpack_U normalize 'C', _pack_U map hex, split ' ', shift;
49 join " ", map sprintf("%04X", $_),
50 _unpack_U normalize 'D', _pack_U map hex, split ' ', shift;
53 ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062");
54 ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062");
55 ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062");
56 ok(hexNFC("0045 0304 0300 AC00 11A8"), "1E14 AC01");
57 ok(hexNFC("1100 1161 1100 1173 11AF"), "AC00 AE00");
58 ok(hexNFC("1100 0300 1161 1173 11AF"), "1100 0300 1161 1173 11AF");
60 ok(hexNFD("0061 0315 0300 05AE 05C4 0062"), "0061 05AE 0300 05C4 0315 0062");
61 ok(hexNFD("00E0 05AE 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062");
62 ok(hexNFD("0061 05AE 0300 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062");
63 ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062");
64 ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062");
65 ok(hexNFD("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062");
66 ok(hexNFD("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062");
67 ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000");
68 ok(hexNFD("0000 0041 0000 0000"), "0000 0041 0000 0000");