6 if (! $Config{'useithreads'}) {
7 print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
12 use ExtUtils::testlib;
17 my ($got, $exp, $name) = @_;
19 my $ok = ($got eq $exp);
21 # You have to do it this way or VMS will get confused.
23 print("ok $TEST - $name\n");
25 print("not ok $TEST - $name\n");
26 printf("# Failed test at line %d\n", (caller)[2]);
27 print("# Got: $got\n");
28 print("# Expected: $exp\n");
38 print("1..12\n"); ### Number of tests that will be run ###
44 ### Start of Testing ###
46 binmode STDOUT, ":utf8";
49 my $utf8 = "\x{123}\x{84}\x{20F}\x{2C1}";
57 is(exists($a{$plain}), 1, 'Found plain key in shared hash');
58 is(exists($a{$utf8}), 1, 'Found UTF-8 key in shared hash');
59 is(exists($a{$code}), 1, 'Found code ref key in shared hash');
61 while (my ($key, $value) = each (%a)) {
63 is($key, $plain, 'Plain key in shared hash');
64 } elsif ($key eq $utf8) {
65 is($key, $utf8, 'UTF-8 key in shared hash');
66 } elsif ($key eq "$code") {
67 is($key, "$code", 'Code ref key in shared hash');
69 is($key, "???", 'Bad key');
78 is(exists($$a{$plain}), 1, 'Found plain key in shared hash ref');
79 is(exists($$a{$utf8}), 1, 'Found UTF-8 key in shared hash ref');
80 is(exists($$a{$code}), 1, 'Found code ref key in shared hash ref');
82 while (my ($key, $value) = each (%$a)) {
84 is($key, $plain, 'Plain key in shared hash ref');
85 } elsif ($key eq $utf8) {
86 is($key, $utf8, 'UTF-8 key in shared hash ref');
87 } elsif ($key eq "$code") {
88 is($key, "$code", 'Code ref key in shared hash ref');
90 is($key, "???", 'Bad key');