X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/a44093a96fbebc6fd778dfaa82b165e9006382a8..527df579b2667fd0b8db4c07bcab268e0f401be9:/ext/XS/APItest/t/hash.t diff --git a/ext/XS/APItest/t/hash.t b/ext/XS/APItest/t/hash.t index 1ef99ed..47d4437 100644 --- a/ext/XS/APItest/t/hash.t +++ b/ext/XS/APItest/t/hash.t @@ -150,6 +150,27 @@ if ($] > 5.009) { } } +{ + my $as_utf8 = "\241" . chr 256; + chop $as_utf8; + my $as_bytes = "\243"; + foreach my $key ('N', $as_bytes, $as_utf8, "\x{2623}") { + my $ord = ord $key; + foreach my $hash_pv (0, 1) { + my %hash; + is (XS::APItest::Hash::common({hv => \%hash, keypv => $key, + val => $ord, hash_pv => $hash_pv, + action => + XS::APItest::HV_FETCH_ISSTORE}), + $ord, "store $ord \$hash_pv = $hash_pv"); + is_deeply ([each %hash], [$key, $ord], "First key read is good"); + is_deeply ([each %hash], [], "No second key good"); + + is ($hash{$key}, $ord, "Direct hash read finds $ord"); + } + } +} + exit; ################################ The End ################################