#!./perl
-#
-# $Id: utf8.t,v 1.0.1.2 2000/09/28 21:44:17 ram Exp $
-#
sub BEGIN {
if ($] < 5.007) {
if ($ENV{PERL_CORE}){
chdir('t') if -d 't';
@INC = ('.', '../lib');
+ 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';
}
}
# 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.
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;
}