Upgrade to Encode 1.90 (plus the one extra use lib in enc_module.t)
[p5sagit/p5-mst-13.2.git] / ext / Encode / t / Aliases.t
index 4c6570f..c270c0e 100644 (file)
@@ -21,17 +21,21 @@ my $ON_EBCDIC;
 sub init_a2c{
     %a2c = (
            'US-ascii' => 'ascii',
+           'ISO-646-US' => 'ascii',
            'UTF-8'    => 'utf8',
            'UCS-2'    => 'UCS-2BE',
            'UCS2'     => 'UCS-2BE',
            'iso-10646-1' => 'UCS-2BE',
            'ucs2-le'  => 'UCS-2LE',
+           'ucs2-be'  => 'UCS-2BE',
            'utf16'    => 'UTF-16',
            'utf32'    => 'UTF-32',
            'utf16-be'  => 'UTF-16BE',
            'utf32-be'  => 'UTF-32BE',
            'utf16-le'  => 'UTF-16LE',
            'utf32-le'  => 'UTF-32LE',
+           'UCS4-BE'   => 'UTF-32BE',
+           'UCS-4-LE'  => 'UTF-32LE',
            'cyrillic' => 'iso-8859-5',
            'arabic'   => 'iso-8859-6',
            'greek'    => 'iso-8859-7',
@@ -57,9 +61,11 @@ sub init_a2c{
            'Shift_JIS'     => $ON_EBCDIC ? '' : 'shiftjis',
            'x-sjis'        => $ON_EBCDIC ? '' : 'shiftjis',
            'jis'           => $ON_EBCDIC ? '' : '7bit-jis',
-           'big-5'         => $ON_EBCDIC ? '' : 'big5',
-           'zh_TW.Big5'    => $ON_EBCDIC ? '' : 'big5',
+           'big-5'         => $ON_EBCDIC ? '' : 'big5-eten',
+           'zh_TW.Big5'    => $ON_EBCDIC ? '' : 'big5-eten',
+           'tca-big5'      => $ON_EBCDIC ? '' : 'big5-eten',
            'big5-hk'       => $ON_EBCDIC ? '' : 'big5-hkscs',
+           'hkscs-big5'    => $ON_EBCDIC ? '' : 'big5-hkscs',
            'GB_2312-80'    => $ON_EBCDIC ? '' : 'euc-cn',
            'KS_C_5601-1987'    => $ON_EBCDIC ? '' : 'cp949',
            #
@@ -81,6 +87,7 @@ sub init_a2c{
        my $v = $Encode::Alias::Winlatin2cp{$k};
        $a2c{"Win" . ucfirst($k)} = "cp" . $v;
        $a2c{"IBM-$v"} = $a2c{"MS-$v"} = "cp" . $v;
+       $a2c{"cp-" . $v} = "cp" . $v;
     }
     my @a2c = keys %a2c;
     for my $k (@a2c){
@@ -112,9 +119,9 @@ use Test::More tests => (scalar keys %a2c) * 4;
 
 print "# alias test;  \$ON_EBCDIC == $ON_EBCDIC\n";
 
-foreach my $a (keys %a2c){          
+foreach my $a (keys %a2c){     
     my $e = Encode::find_encoding($a);
-    is((defined($e) and $e->name), $a2c{$a})
+    is((defined($e) and $e->name), $a2c{$a},$a)
        or warn "alias was $a";;
 }
 
@@ -130,18 +137,18 @@ define_alias(
 
 print "# alias test with alias overrides\n";
 
-foreach my $a (keys %a2c){          
+foreach my $a (keys %a2c){     
     my $e = Encode::find_encoding($a);
-    is((defined($e) and $e->name), $a2c{$a})
+    is((defined($e) and $e->name), $a2c{$a}, "Override $a")
        or warn "alias was $a";
 }
 
 print "# alias undef test\n";
 
 Encode::Alias->undef_aliases;
-foreach my $a (keys %a2c){          
+foreach my $a (keys %a2c){     
     my $e = Encode::find_encoding($a);
-    ok(!defined($e) || $e->name =~ /-raw$/o)
+    ok(!defined($e) || $e->name =~ /-raw$/o,"Undef $a")
        or warn "alias was $a";
 }
 
@@ -149,9 +156,9 @@ print "# alias reinit test\n";
 
 Encode::Alias->init_aliases;
 init_a2c();
-foreach my $a (keys %a2c){          
+foreach my $a (keys %a2c){     
     my $e = Encode::find_encoding($a);
-    is((defined($e) and $e->name), $a2c{$a})
+    is((defined($e) and $e->name), $a2c{$a}, "Reinit $a")
        or warn "alias was $a";
 }
 __END__