diff options
author | 2014-03-24 14:58:42 +0000 | |
---|---|---|
committer | 2014-03-24 14:58:42 +0000 | |
commit | 91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch) | |
tree | 3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/cpan/Encode/t/Encode.t | |
parent | do not call purge_task every 10 secs, it is only needed once at startup and (diff) | |
download | wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip |
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Encode/t/Encode.t')
-rwxr-xr-x | gnu/usr.bin/perl/cpan/Encode/t/Encode.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/cpan/Encode/t/Encode.t b/gnu/usr.bin/perl/cpan/Encode/t/Encode.t index 369557ef1dc..918975eb4c5 100755 --- a/gnu/usr.bin/perl/cpan/Encode/t/Encode.t +++ b/gnu/usr.bin/perl/cpan/Encode/t/Encode.t @@ -25,7 +25,7 @@ my @character_set = ('0'..'9', 'A'..'Z', 'a'..'z'); my @source = qw(ascii iso8859-1 cp1250); my @destiny = qw(cp1047 cp37 posix-bc); my @ebcdic_sets = qw(cp1047 cp37 posix-bc); -plan test => 38+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256 + 6 + 2; +plan test => 38+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256 + 6 + 4; my $str = join('',map(chr($_),0x20..0x7E)); my $cpy = $str; ok(length($str),from_to($cpy,'iso8859-1','Unicode'),"Length Wrong"); @@ -149,3 +149,14 @@ sub new { my $class = shift; bless [ @_ ] => $class } package main; ok(decode(latin1 => Encode::Dummy->new("foobar")), "foobar"); ok(encode(utf8 => Encode::Dummy->new("foobar")), "foobar"); + +# hash keys +my $key = (keys %{{ "whatever\x{100}" => '' }})[0]; +my $kopy = $key; +encode("UTF-16LE", $kopy, Encode::FB_CROAK); +ok $key, "whatever\x{100}", 'encode with shared hash key scalars'; +undef $key; +$key = (keys %{{ "whatever" => '' }})[0]; +$kopy = $key; +decode("UTF-16LE", $kopy, Encode::FB_CROAK); +ok $key, "whatever", 'decode with shared hash key scalars'; |