In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5064495bb4e4885232438df9bc66e685c1e6b98b?hp=67bf5a37856bcd50cc76a9af8d4264b205a27c1b>
- Log ----------------------------------------------------------------- commit 5064495bb4e4885232438df9bc66e685c1e6b98b Author: Karl Williamson <[email protected]> Date: Sun Jul 30 21:47:17 2017 -0600 APItest/t/utf8_warn_base.pl: Fix broken tests There was a typo in one test, and in the other, the code point is output as Unicode, not native. M ext/XS-APItest/t/utf8_warn_base.pl commit fd7855d2ae368a7e77b08995e5cf9654b2e320bb Author: Karl Williamson <[email protected]> Date: Sun Jul 30 21:45:44 2017 -0600 APItest/t/utf8.t: Fix broken test on EBCDIC Perl-extended UTF-8 begins at a different code point on EBCDIC platforms. M ext/XS-APItest/t/utf8.t ----------------------------------------------------------------------- Summary of changes: ext/XS-APItest/t/utf8.t | 6 ++++-- ext/XS-APItest/t/utf8_warn_base.pl | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/XS-APItest/t/utf8.t b/ext/XS-APItest/t/utf8.t index 37c65aa8e1..a463d1b6eb 100644 --- a/ext/XS-APItest/t/utf8.t +++ b/ext/XS-APItest/t/utf8.t @@ -41,6 +41,8 @@ my $look_for_everything_uvchr_to | $::UNICODE_DISALLOW_PERL_EXTENDED | $::UNICODE_WARN_PERL_EXTENDED; +my $highest_non_extended_cp = 2 ** ((isASCII) ? 31 : 30) - 1; + foreach ([0, '', '', 'empty'], [0, 'N', 'N', '1 char'], [1, 'NN', 'N', '1 char substring'], @@ -625,7 +627,7 @@ for my $u (sort { utf8::unicode_to_native($a) <=> utf8::unicode_to_native($b) } $this_utf8_flags &= ~($::UTF8_DISALLOW_SUPER|$::UTF8_WARN_SUPER); $valid_under_strict = 0; $valid_under_c9strict = 0; - if ($n > 2 ** 31 - 1) { + if ($n > $highest_non_extended_cp) { $this_utf8_flags &= ~($::UTF8_DISALLOW_PERL_EXTENDED|$::UTF8_WARN_PERL_EXTENDED); $valid_for_not_extended_utf8 = 0; @@ -782,7 +784,7 @@ for my $u (sort { utf8::unicode_to_native($a) <=> utf8::unicode_to_native($b) } # Similarly for uvchr_to_utf8 my $this_uvchr_flags = $look_for_everything_uvchr_to; - if ($n > 2 ** 31 - 1) { + if ($n > $highest_non_extended_cp) { $this_uvchr_flags &= ~($::UNICODE_DISALLOW_PERL_EXTENDED|$::UNICODE_WARN_PERL_EXTENDED); } diff --git a/ext/XS-APItest/t/utf8_warn_base.pl b/ext/XS-APItest/t/utf8_warn_base.pl index 3eddeaad9c..07652e8353 100644 --- a/ext/XS-APItest/t/utf8_warn_base.pl +++ b/ext/XS-APItest/t/utf8_warn_base.pl @@ -121,7 +121,7 @@ my @tests; ], [ "overlong malformation, highest 2-byte", (isASCII) ? "\xc1\xbf" : I8_to_native("\xc4\xbf"), - (isASCII) ? 0x7F : utf8::unicode_to_native(0x9F), + (isASCII) ? 0x7F : 0x9F, # Output as U+, so no need to xlate ], [ "overlong malformation, lowest 3-byte", (isASCII) ? "\xe0\x80\x80" : I8_to_native("\xe0\xa0\xa0"), @@ -524,6 +524,7 @@ my @tests; I8_to_native( "\xff\xa0\xa0\xa0\xa0\xa0\xa1\xa0\xa0\xa0\xa0\xa0\xa0\xa0"), 0x800000000, + 40000000 ], [ "requires at least 32 bits", I8_to_native( -- Perl5 Master Repository
