diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-05 20:46:58 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-05 20:46:58 +0000 |
commit | f2b0cce78405182ac37776a9f6651ef31c276b8f (patch) | |
tree | cf1bb0094fa7bb6e3105258013ba7bb243770d85 | |
parent | 3b5dab68882760bd07996befd442dd41c721a7f4 (diff) | |
download | perl-f2b0cce78405182ac37776a9f6651ef31c276b8f.tar.gz |
Test for Unicode (UTF-8) hash keys.
p4raw-id: //depot/perl@7999
-rwxr-xr-x | t/op/each.t | 14 |
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"; |