summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-05 20:46:58 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-05 20:46:58 +0000
commitf2b0cce78405182ac37776a9f6651ef31c276b8f (patch)
treecf1bb0094fa7bb6e3105258013ba7bb243770d85
parent3b5dab68882760bd07996befd442dd41c721a7f4 (diff)
downloadperl-f2b0cce78405182ac37776a9f6651ef31c276b8f.tar.gz
Test for Unicode (UTF-8) hash keys.
p4raw-id: //depot/perl@7999
-rwxr-xr-xt/op/each.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/each.t b/t/op/each.t
index 879c0d0fd3..4a00a1e2c5 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";