In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/bccb768e4d426a431a6e9e675d1d3934a98fa089?hp=2c4879e2628d6fa5a764e130f610deaff6f859a5>
- Log ----------------------------------------------------------------- commit bccb768e4d426a431a6e9e675d1d3934a98fa089 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 18 20:20:06 2016 -0700 bop.t: Delete $SIG{__WARN__} It is only needed for one block of tests. Leaving the handler in place makes it harder to add temporary diagnostics elsewhere in the code. (Where did my warning go? Hey, why is âwarnâ not work- ing?????!!!! :-) M t/op/bop.t commit b43665fffa48dd179eba1b5616d4ca35b4def876 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 18 20:17:08 2016 -0700 [perl #129287] Make UTF8 & append null The & and &. operators were not appending a null byte to the string in utf8 mode. (The internal function that they use is the same. I used &. in the test just because its intent is clearer.) M doop.c M t/op/bop.t commit 71c89c826804a03f81e980d5286fdb0444490d86 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 18 12:19:13 2016 -0700 regexp.t: Update comments about column 1 Years out of date! M t/re/regexp.t ----------------------------------------------------------------------- Summary of changes: doop.c | 1 + t/op/bop.t | 16 +++++++++++++++- t/re/regexp.t | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doop.c b/doop.c index ad9172a..234a425 100644 --- a/doop.c +++ b/doop.c @@ -1093,6 +1093,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right) if (sv == left || sv == right) (void)sv_usepvn(sv, dcorig, needlen); SvCUR_set(sv, dc - dcorig); + *SvEND(sv) = 0; break; case OP_BIT_XOR: while (lulen && rulen) { diff --git a/t/op/bop.t b/t/op/bop.t index 2afb8d7..f9bf1c5 100644 --- a/t/op/bop.t +++ b/t/op/bop.t @@ -19,7 +19,7 @@ BEGIN { # If you find tests are failing, please try adding names to tests to track # down where the failure is, and supply your new names as a patch. # (Just-in-time test naming) -plan tests => 192 + (10*13*2) + 5 + 29; +plan tests => 192 + (10*13*2) + 5 + 30; # numerics ok ((0xdead & 0xbeef) == 0x9ead); @@ -567,6 +567,8 @@ for ( } } +delete $SIG{__WARN__}; + my $strval; { @@ -664,3 +666,15 @@ is $^A, "123", '~v0 clears vstring magic on retval'; is(-1 >> $w + 1, -1, "IV -1 right shift $w + 1 == -1"); } } + +# [perl #129287] UTF8 & was not providing a trailing null byte. +# This test is a bit convoluted, as we want to make sure that the string +# allocated for &âs target contains memory initialised to something other +# than a null byte. Uninitialised memory does not make for a reliable +# test. So we do &. on a longer non-utf8 string first. +for (["aaa","aaa"],[substr ("a\x{100}",0,1), "a"]) { + use feature "bitwise"; + no warnings "experimental::bitwise", "pack"; + $byte = substr unpack("P2", pack "P", $$_[0] &. $$_[1]), -1; +} +is $byte, "\0", "utf8 &. appends null byte"; diff --git a/t/re/regexp.t b/t/re/regexp.t index 2cbfc9f..1e85c93 100644 --- a/t/re/regexp.t +++ b/t/re/regexp.t @@ -5,8 +5,9 @@ # There are five columns, separated by tabs. # An optional sixth column is used to give a reason, only when skipping tests # -# Column 1 contains the pattern, optionally enclosed in C<''>. -# Modifiers can be put after the closing C<'>. +# Column 1 contains the pattern, optionally enclosed in C<''> C<::> or +# C<//>. Modifiers can be put after the closing delimiter. C<''> will +# automatically be added to any other patterns. # # Column 2 contains the string to be matched. # -- Perl5 Master Repository