diff options
author | Tony Cook <tony@develop-help.com> | 2017-08-08 14:45:29 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2017-08-08 14:45:29 +1000 |
commit | 9c6b56dc65cdd9256fbe04a7baf4f085db1c04dd (patch) | |
tree | 743ec41b124bc24ada48fae1cedc4498f50c1c2b | |
parent | 13f60a098562e1ce7ab09819568bb8a03b617a60 (diff) | |
download | perl-9c6b56dc65cdd9256fbe04a7baf4f085db1c04dd.tar.gz |
(perl #131646) make the test less fragile
The original pattern "UXp>" with the $_ that causes the failure, 5,
so we end up packing exp(5) or 148.... with U packs:
- U (148), producing C2 94, with the UTF8 flag set
- X - back up a byte,
- p> - write the address of PL_sv_no's PV in big-ending
The final p> will typically overwrite the 94 with a zero on 64-bit
systems, but with the smaller address space of 32-bit systems that
high-byte is more likely to be a valid continuation byte, causing
the comparison to fail.
Instead just pack a zero byte.
-rw-r--r-- | t/lib/warnings/utf8 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8 index dfc58c12db..a9a6388d31 100644 --- a/t/lib/warnings/utf8 +++ b/t/lib/warnings/utf8 @@ -779,7 +779,7 @@ BEGIN{ } no warnings; use warnings 'utf8'; -for(uc 0..t){0~~pack"UXp>",exp} +for(uc 0..t){0~~pack"UXc",exp} EXPECT OPTIONS regex Malformed UTF-8 character: \\x([[:xdigit:]]{2})\\x([[:xdigit:]]{2}) \(unexpected non-continuation byte 0x\2, immediately after start byte 0x\1; need 2 bytes, got 1\) in smart match at - line 9. |