diff options
author | Marc Lehmann <pcg@goof.com> | 2007-04-12 10:41:53 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-05-10 12:41:08 +0000 |
commit | 1651fc447620d3610b694c35696c13530282f981 (patch) | |
tree | 482a8b5110d6232c00a8ca636cbf9cec7e723652 /ext | |
parent | ad91da88822a061453a454578ec2246dd493ffdd (diff) | |
download | perl-1651fc447620d3610b694c35696c13530282f981.tar.gz |
Re: Compress::Zlib, pack "C" and utf-8 [PATCH]
Message-ID: <20070412064153.GA22475@schmorp.de>
p4raw-id: //depot/perl@31194
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Encode/t/encoding.t | 2 | ||||
-rw-r--r-- | ext/Storable/t/utf8hash.t | 9 | ||||
-rw-r--r-- | ext/Unicode/Normalize/t/short.t | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/ext/Encode/t/encoding.t b/ext/Encode/t/encoding.t index 67ea068087..b17b11fc44 100644 --- a/ext/Encode/t/encoding.t +++ b/ext/Encode/t/encoding.t @@ -57,7 +57,7 @@ print "not " unless unpack("C", pack("C", 0xdf)) == 0xdf; print "ok 8\n"; # the first octet of UTF-8 encoded 0x3af -print "not " unless unpack("C", chr(0xdf)) == 0xce; +print "not " unless unpack("U0 C", chr(0xdf)) == 0xce; print "ok 9\n"; print "not " unless unpack("U", pack("U", 0xdf)) == 0xdf; diff --git a/ext/Storable/t/utf8hash.t b/ext/Storable/t/utf8hash.t index eeb80eb86e..a529ea5626 100644 --- a/ext/Storable/t/utf8hash.t +++ b/ext/Storable/t/utf8hash.t @@ -34,7 +34,7 @@ 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 (); my %utf8hash; @@ -57,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; } diff --git a/ext/Unicode/Normalize/t/short.t b/ext/Unicode/Normalize/t/short.t index d799f4a096..a9e444f98a 100644 --- a/ext/Unicode/Normalize/t/short.t +++ b/ext/Unicode/Normalize/t/short.t @@ -35,7 +35,7 @@ print "ok 1\n"; no warnings qw(utf8); # U+3042 is 3-byte length (in UTF-8/UTF-EBCDIC) -our $a = pack 'U0C', unpack 'C', "\x{3042}"; +our $a = pack 'U0C', unpack 'U0C', "\x{3042}"; print NFD($a) eq "\0" ? "ok" : "not ok", " 2\n"; |