develooper Front page | perl.perl5.porters | Postings from March 2022

Request for help related to t/overload.t

Thread Next
From:
Neil Bowers
Date:
March 7, 2022 22:35
Subject:
Request for help related to t/overload.t
Message ID:
9db4feb4-7c11-4f0d-9ef5-eb6fdb566f49@Spark
I’m asking for help from anyone who understands t/overload.t

As part of the work to add the Configure question on taint support, I’ve been working through the tests, so that taint tests are skipped.

I’ve got t/overload.t passing with a no-taint perl, but I’d like help from someone who really understands these tests, to be sure that one part of my changes are acceptable.

There are three places where I had to skip some tests.

The first two are straightforward, as they have an explicit check for something that is expected to be tainted. If perl doesn’t support taint, then it now skips those tests.

The problematic test was this line:

	is($fetches, $exp_fetch, "$desc FETCH count");

This is called many times; for each call the $desc is unique. There are 6 cases when this test fails under taint-free perl. I’ve added a hash with the $desc string for those six tests, and now it will skip those 6 tests if running under a perl that doesn’t support taint. The testsuite passes on both perl with and without taint support.

But I don’t really understand the tests, so I’m not sure whether this is the right thing to do. My theory at the moment is that these tests are tied variables, and in these 6 tests, it only expects one FETCH to happen, because then a taint check then throws a fatal error, so the subsequent FETCH never happens. But on a taint-free perl the fatal error doesn’t happen, so another FETCH happens, and that’s why the number of fetches doesn’t match the expected number of fetches.

I’m on #p5p on IRC, or you can email me back.

Neil

Thread Next


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