5 if ($ENV{'PERL_CORE'}){
7 unshift @INC, '../lib';
10 if (! $Config{'useithreads'}) {
11 print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
16 use ExtUtils::testlib;
21 my ($got, $exp, $name) = @_;
23 my $ok = ($got eq $exp);
25 # You have to do it this way or VMS will get confused.
27 print("ok $TEST - $name\n");
29 print("not ok $TEST - $name\n");
30 printf("# Failed test at line %d\n", (caller)[2]);
31 print("# Got: $got\n");
32 print("# Expected: $exp\n");
42 print("1..12\n"); ### Number of tests that will be run ###
48 ### Start of Testing ###
50 binmode STDOUT, ":utf8";
53 my $utf8 = "\x{123}\x{84}\x{20F}\x{2C1}";
61 is(exists($a{$plain}), 1, 'Found plain key in shared hash');
62 is(exists($a{$utf8}), 1, 'Found UTF-8 key in shared hash');
63 is(exists($a{$code}), 1, 'Found code ref key in shared hash');
65 while (my ($key, $value) = each (%a)) {
67 is($key, $plain, 'Plain key in shared hash');
68 } elsif ($key eq $utf8) {
69 is($key, $utf8, 'UTF-8 key in shared hash');
70 } elsif ($key eq "$code") {
71 is($key, "$code", 'Code ref key in shared hash');
73 is($key, "???", 'Bad key');
82 is(exists($$a{$plain}), 1, 'Found plain key in shared hash ref');
83 is(exists($$a{$utf8}), 1, 'Found UTF-8 key in shared hash ref');
84 is(exists($$a{$code}), 1, 'Found code ref key in shared hash ref');
86 while (my ($key, $value) = each (%$a)) {
88 is($key, $plain, 'Plain key in shared hash ref');
89 } elsif ($key eq $utf8) {
90 is($key, $utf8, 'UTF-8 key in shared hash ref');
91 } elsif ($key eq "$code") {
92 is($key, "$code", 'Code ref key in shared hash ref');
94 is($key, "???", 'Bad key');