utf8hash.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
sub BEGIN {
if ($] < 5.007) {
print "1..0 # Skip: no utf8 hash key support\n";
exit 0;
}
chdir('t') if -d 't';
# Look, I'm using this fully-qualified variable more than once!
my $arch = $MacPerl::Architecture;
}
} else {
}
print "1..0 # Skip: Storable was not built\n";
exit 0;
}
}
}
use strict;
{
}
# 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 bytes ();
my %utf8hash;
# first we generate a nasty hash which keys include both utf8
# on and off with identical PVs
# In Latin 1 -ese the below ord() should end up 0xc0 (192),
# in EBCDIC 0x64 (100). Both should end up being UTF-8/UTF-EBCDIC.
my @ords = (
0x3000, #IDEOGRAPHIC SPACE
);
# warn sprintf "%d,%d", bytes::length($u), is_utf8($u);
# warn sprintf "%d,%d" ,bytes::length($b), is_utf8($b);
isnt($u, $b,
"equivalence - with utf8flag");
"equivalence - without utf8flag");
}
my $href = shift;
}
my $nk;
# now let the show begin!
}
my $retrieved;
}
}
# On the premis that more tests are good, here are NWC's tests:
sub me_second {
}
# Set this to 1 to test the test by bypassing Storable.
my $bypass = 0;
sub class_test {
return;
}
}
# Thanks to Dan Kogai for the Kanji for "castle" (which he informs me also
# means 'a city' in Mandarin).
# Run through and sanity check these.
}
my $l = 0 + /^\w+$/;
my $r = 0 + $hash{$_} =~ /^\w+$/;
}
# Grr. This cperl mode thinks that ${ is a punctuation variable.
# I presume it's punishment for using xemacs rather than emacs. Or OS/2 :-)
my $l = 0 + /^\w+$/;
my $r = 0 + $copy->{$_} =~ /^\w+$/;
}
}
}
}
}
}