From: Jarkko Hietaniemi Date: Tue, 5 Dec 2000 20:46:58 +0000 (+0000) Subject: Test for Unicode (UTF-8) hash keys. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2b0cce78405182ac37776a9f6651ef31c276b8f;p=p5sagit%2Fp5-mst-13.2.git Test for Unicode (UTF-8) hash keys. p4raw-id: //depot/perl@7999 --- diff --git a/t/op/each.t b/t/op/each.t index 879c0d0..4a00a1e 100755 --- a/t/op/each.t +++ b/t/op/each.t @@ -1,6 +1,6 @@ #!./perl -print "1..19\n"; +print "1..20\n"; $h{'abc'} = 'ABC'; $h{'def'} = 'DEF'; @@ -131,3 +131,15 @@ if ($i == 5) { print "ok 16\n" } else { print "not ok\n" } print "ok 19\n"; } +# Check for Unicode hash keys. +%u = ("\x{12}", "f", "\x{123}", "fo", "\x{1234}", "foo"); +$u{"\x{12345}"} = "bar"; +@u{"\x{123456}"} = "zap"; + +foreach (keys %u) { + unless (length() == 1) { + print "not "; + last; + } +} +print "ok 20\n";