On Thu Oct 30 08:47:32 2014, Hugmeir wrote: > I was trying to build perl on Android and spotted this failure: > > t/../ext/XS-APItest/t/svpeek ... 1..52 > ok 1 - use XS::APItest; > ok 2 - $/ > ok 3 - $\ > ok 4 - $. > ok 5 - $, > ok 6 - $; > ok 7 - $" > ok 8 - $: > ok 9 - $~ > ok 10 - $^ > ok 11 - $= > ok 12 - $- > ok 13 - $! > ok 14 - $? > ok 15 - $| > not ok 16 - $1 > # Failed test ' $1' > # at t/svpeek.t line 31. > # got: 'PVMG("t"\0)' > # expected: 'PVMG()' > # Looks like you failed 1 test of 52. > FAILED at test 16 > Failed 1 test out of 1, 0.00% okay. > ../ext/XS-APItest/t/svpeek.t > > The test itself is this: > > "abc" =~ m/(b)/; # Don't know why these magic vars have this content > is (DPeek ($1), 'PVMG()', ' $1'); > > where DPeek is a wrapper around sv_peek() from dump.c. I may be > missing something, but it looks like the test itself has two wrongs: > First, it needs to use $1 for the value of the previous match to get > populated; second, if it wanted 'PVMG()', then the regex prior should > either not capture anything, or fail. > > The attached patch solves the issue for me, but I'm rather curious as > to why this only affected Android. That test was last touched in 07308ed1, a recent Test-Simple upgrade. At the time I saw it, but assumed the test was just a little too sensitive to internals, or that using like() on $1 didn’t work any more. This seems to show the difference: $ ./perl -Ilib -MXS::APItest= -e ' "abc" =~ m/(b)/;; warn DPeek($1)' PVMG() at -e line 1. $ ./perl -Ilib -MXS::APItest= -e ' "abc" =~ m/(b)/;; "$1"; warn DPeek($1)' PVMG("b"\0) at -e line 1. So, somewhere, something is stringifying the $1 (or calling get-magic some other way). -- Father Chrysostomos --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=123089Thread Next