Subject: | Unicode::UTF8 Testing bug |
Date: | Fri, 31 Aug 2018 15:10:20 +0000 |
To: | "bug-Unicode-UTF8 [...] rt.cpan.org" <bug-Unicode-UTF8 [...] rt.cpan.org> |
From: | Stephan Latta <Stephan.M.Latta-nr [...] raytheon.com> |
Christian,
I'm working on a project that requires me to create a 32-bit and 64-bit version of Perl v5.28.0. During the inclusion of your Unicode::UTF8 module, I noticed that the 080_super.t test case does not take into account the Perl bit architecture and thus fails on a 32-bit Perl version.
An plausible updated version of the test is shown below:
#!perl
use Config; ### Inclusion of the Config module
use strict;
use warnings;
use lib 't';
use Test::More tests => 1537;
use Util qw[throws_ok];
BEGIN {
use_ok('Unicode::UTF8', qw[ encode_utf8 ]);
}
my @SUPER = ();
{
for (my $i = 0x0011_0000; $i < 0x7FFF_FFFF; $i += 0x200000) {
push @SUPER, $i;
}
###
### 64-bit ptrsize validation against the Config module
###
if ($Config{ptrsize} == 8) {
for (my $i = 0x8000_0000; $i < 0xFFFF_FFFF; $i += 0x400000) {
push @SUPER, $i;
}
}
}
foreach my $cp (@SUPER) {
my $name = sprintf 'encode_utf8("\\x{%.4X}") super U-%.8X',
$cp, $cp;
my $string = do { no warnings 'utf8'; pack('U', $cp) };
throws_ok {
use warnings FATAL => 'utf8';
encode_utf8($string);
} qr/Can't represent super code point/, $name;
}
Kind Regards,
Stephan M. Latta
NISSC Software Engineer
Raytheon / Braxton Technologies
1330 Inverness Drive, Suite 450-1
Colorado Springs, CO 80910
Voice: (719) 622-2269<tel:%28719%29%20637-4286>
E-mail: stephan.m.latta-nr@raytheon.com<mailto:stephan.m.latta-nr@raytheon.com>
[Braxton_logo]<http://www.braxtontech.com/>