In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/16a07156bec367e245074eb7448892c5f81feeef?hp=43dbb3c1592f7f9ccbe0aba64ef2684f39b673ed>
- Log ----------------------------------------------------------------- commit 16a07156bec367e245074eb7448892c5f81feeef Author: Karl Williamson <[email protected]> Date: Tue Feb 7 13:12:36 2017 -0700 Add .t for malformed-UTF-8 toke.c testing This adds a non-UTF-8 encoded file to make it easier to test malformed UTF-8 strings. The file is automatically skipped on EBCDIC platforms. The file is initialized with a test for [perl #129037], which had already been unknowingly fixed by commit 75219bacf5aacd315b96083de24e82cd8238e99a ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 + t/lib/common.pl | 4 ++++ t/lib/croak/toke_l1 | 9 +++++++++ 3 files changed, 14 insertions(+) create mode 100644 t/lib/croak/toke_l1 diff --git a/MANIFEST b/MANIFEST index 9b5720a1ce..3552b60e0f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5333,6 +5333,7 @@ t/lib/croak/pp_ctl Test croak calls from pp_ctl.c t/lib/croak/pp_hot Test croak calls from pp_hot.c t/lib/croak/pp_sys Test croak calls from pp_sys.c t/lib/croak/toke Test croak calls from toke.c +t/lib/croak/toke_l1 Test croak calls from toke.c; file is not UTF-8 encoded t/lib/cygwin.t Builtin cygwin function tests t/lib/dbmt_common.pl Common functionality for ?DBM_File tests t/lib/deprecate.t Test deprecate.pm diff --git a/t/lib/common.pl b/t/lib/common.pl index 561e1ffca8..9c7060ff38 100644 --- a/t/lib/common.pl +++ b/t/lib/common.pl @@ -31,6 +31,10 @@ if (@ARGV) { glob catfile(curdir(), "lib", $pragma_name, "*"); } +if ($::IS_EBCDIC) { # Skip Latin1 files + @w_files = grep { $_ !~ / _l1 $/x } @w_files +} + my ($tests, @prgs) = setup_multiple_progs(@w_files); $^X = rel2abs($^X); diff --git a/t/lib/croak/toke_l1 b/t/lib/croak/toke_l1 new file mode 100644 index 0000000000..9a2c99305e --- /dev/null +++ b/t/lib/croak/toke_l1 @@ -0,0 +1,9 @@ +# File is encoded in latin-1 so can have malformed-utf8 +__END__ +# NAME [perl #129037] +BEGIN{{};$^H=-1}0Ã +EXPECT +Malformed UTF-8 character: \xc3\x0a (unexpected non-continuation byte 0x0a, immediately after start byte 0xc3; need 2 bytes, got 1) at - line 1. +Constant(0): $^H{integer} is not defined at - line 1, at end of line +Malformed UTF-8 character (fatal) at - line 1. +######## -- Perl5 Master Repository
