Fix up .gitignore files some more
[p5sagit/p5-mst-13.2.git] / ext / Storable / t / utf8hash.t
index 7d842d5..a529ea5 100644 (file)
@@ -8,7 +8,11 @@ sub BEGIN {
     if ($ENV{PERL_CORE}){
        chdir('t') if -d 't';
        @INC = ('.', '../lib');
-       push @INC, "::lib:$MacPerl::Architecture:" if $^O eq 'MacOS';
+        if ($^O eq 'MacOS') {
+            # Look, I'm using this fully-qualified variable more than once!
+            my $arch = $MacPerl::Architecture;
+            push @INC, "::lib:${MacPerl::Architecture}:";
+        }
     } else {
        unshift @INC, 't';
     }
@@ -30,9 +34,8 @@ use Storable qw(store nstore retrieve thaw freeze);
 }
 # Better than no plan, because I was getting out of memory errors, at which
 # point Test::More tidily prints up 1..79 as if I meant to finish there.
-use Test::More tests=>148;
+use Test::More tests=>144;
 use bytes ();
-use Encode qw(is_utf8);
 my %utf8hash;
 
 $Storable::canonical = $Storable::canonical; # Shut up a used only once warning.
@@ -54,13 +57,10 @@ my @ords = (
 foreach my $i (@ords){
     my $u = chr($i); utf8::upgrade($u);
     # warn sprintf "%d,%d", bytes::length($u), is_utf8($u);
-    my $b = pack("C*", unpack("C*", $u));
+    my $b = chr($i); utf8::encode($b);
     # warn sprintf "%d,%d" ,bytes::length($b), is_utf8($b);
 
-    isnt($u,                           $b, 
-        "equivalence - with utf8flag");
-    is   (pack("C*", unpack("C*", $u)), pack("C*", unpack("C*", $b)),
-         "equivalence - without utf8flag");
+    isnt($u, $b, "equivalence - with utf8flag");
 
     $utf8hash{$u} = $utf8hash{$b} = $i;
 }