Upgrade to Encode 2.00.
[p5sagit/p5-mst-13.2.git] / ext / Encode / t / jperl.t
index 4899905..60b0317 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: jperl.t,v 1.20 2002/04/04 19:50:52 dankogai Exp dankogai $
+# $Id: jperl.t,v 2.0 2004/05/16 20:55:18 dankogai Exp $
 #
 # This script is written in euc-jp
 
@@ -20,8 +20,11 @@ BEGIN {
     $| = 1;
 }
 
+no utf8; # we have raw Japanese encodings here
+
 use strict;
-use Test::More tests => 15;
+#use Test::More tests => 18;
+use Test::More tests => 15; # black magic tests commented out
 my $Debug = shift;
 
 no encoding; # ensure
@@ -58,16 +61,40 @@ is(length($Namae), 4, q{utf8:length});
 }
 # should've been isnt() but no scoping is suported -- yet
 ok(! defined(${^ENCODING}), q{not scoped yet});
-{
-    # now let's try some real black magic!
-    local(${^ENCODING}) = Encode::find_encoding("euc-jp");
-    my $str = "\xbe\xae\xbb\xf4\x20\xc3\xc6";
-   is (length($str), 4, q{black magic:length});
-   is ($str, $Enamae,   q{black magic:eq});
-}
-ok(! defined(${^ENCODING}), q{out of black magic});
+
+#
+# The following tests are commented out to accomodate
+# Inaba-San's patch to make tr/// work w/o eval qq{}
+#{
+#    # now let's try some real black magic!
+#    local(${^ENCODING}) = Encode::find_encoding("euc-jp");
+#    my $str = "\xbe\xae\xbb\xf4\x20\xc3\xc6";
+#   is (length($str), 4, q{black magic:length});
+#   is ($str, $Enamae,   q{black magic:eq});
+#}
+#ok(! defined(${^ENCODING}), q{out of black magic});
 use bytes;
 is (length($Namae), 10);
+
+#
+# now something completely different!
+#
+{
+    use encoding "euc-jp", Filter=>1;
+    ok(1, "Filter on");
+    use utf8;
+    no strict 'vars'; # fools
+    # doesn't work w/ "my" as of this writing.
+    # because of  buggy strict.pm and utf8.pm
+    our $¿Í = 2; 
+    #   ^^U+4eba, "human" in CJK ideograph
+    $¿Í++; # a child is born
+    *people = \$¿Í;
+    is ($people, 3, "Filter:utf8 identifier");
+    no encoding;
+    ok(1, "Filter off");
+}
+
 1;
 __END__