From: Nicholas Clark Date: Mon, 1 Apr 2002 19:30:05 +0000 (+0100) Subject: (not solving: Re: Storable can't do utf8 hash keys) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c79aee67645b3034181e6f944790f4291f07cbd;p=p5sagit%2Fp5-mst-13.2.git (not solving: Re: Storable can't do utf8 hash keys) Message-ID: <20020401183004.GH319@Bagpuss.unfortu.net> p4raw-id: //depot/perl@15664 --- diff --git a/t/op/pat.t b/t/op/pat.t index 82749a0..2ae16c1 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..908\n"; +print "1..897\n"; BEGIN { chdir 't' if -d 't'; @@ -2772,40 +2772,9 @@ print "# some Unicode properties\n"; } } - -{ - print "# Unicode hash keys and \\w\n"; - # This is not really a regex test but regexes bring - # out the issue nicely. - use strict; - my $test = 893; - my $u3 = "f\x{df}\x{100}"; - my $u2 = substr($u3,0,2); - my $u1 = substr($u2,0,1); - my %u = ( $u1 => $u1, $u2 => $u2, $u3 => $u3 ); - - for (keys %u) { - print /^\w+$/ && $u{$_} =~ /^\w+$/ ? - "ok $test\n" : "not ok $test\n"; - $test++; - } - - for (each %u) { - print /^\w+$/ && $u{$_} =~ /^\w+$/ ? - "ok $test\n" : "not ok $test\n"; - $test++; - } - - for (%u) { - print /^\w+$/ && $u{$_} =~ /^\w+$/ ? - "ok $test\n" : "not ok $test\n"; - $test++; - } -} - { print "# qr/.../x\n"; - my $test = 904; + my $test = 893; my $R = qr/ A B C # D E/x; @@ -2821,7 +2790,7 @@ print "# some Unicode properties\n"; { print "# illegal Unicode properties\n"; - my $test = 907; + my $test = 896; print eval { "a" =~ /\pq / } ? "not ok $test\n" : "ok $test\n"; $test++; diff --git a/t/op/utfhash.t b/t/op/utfhash.t index 54f77bb..e2337e0 100644 --- a/t/op/utfhash.t +++ b/t/op/utfhash.t @@ -3,7 +3,7 @@ BEGIN { @INC = '../lib'; require './test.pl'; - plan(tests => 37); + plan(tests => 48); } # Two hashes one will all keys 8-bit possible (initially), other @@ -77,3 +77,26 @@ foreach my $a ("\x7f","\xff") } + +{ + print "# Unicode hash keys and \\w\n"; + # This is not really a regex test but regexes bring + # out the issue nicely. + use strict; + my $u3 = "f\x{df}\x{100}"; + my $u2 = substr($u3,0,2); + my $u1 = substr($u2,0,1); + my %u = ( $u1 => $u1, $u2 => $u2, $u3 => $u3 ); + + for (keys %u) { + ok (/^\w+$/ && $u{$_} =~ /^\w+$/, "\\w on keys"); + } + + for (each %u) { + ok (/^\w+$/ && $u{$_} =~ /^\w+$/, "\\w on each"); + } + + for (%u) { + ok (/^\w+$/ && $u{$_} =~ /^\w+$/, "\\w on hash"); + } +}