develooper Front page | perl.perl5.porters | Postings from October 2014

[perl #123089] ext/XS-APItest/t/svpeek.t fails on Android

Thread Previous
From:
Brian Fraser
Date:
October 30, 2014 15:47
Subject:
[perl #123089] ext/XS-APItest/t/svpeek.t fails on Android
Message ID:
rt-4.0.18-20719-1414684052-1210.123089-75-0@perl.org
# New Ticket Created by  Brian Fraser 
# Please include the string:  [perl #123089]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123089 >


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.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About