On Thu, Oct 28, 2004 at 01:31:40PM +1000, [EMAIL PROTECTED] wrote:

> I dont know if the code under test is wrong or the expected output.
> 
> I run RH9, which uses Perl 5.8.0. I was getting a failure for 
> t/aspecial_blocks, indicating a difference in the expected output for a 
> CHECK {} block.

If I remember correctly, RH9 shipped with a 5.8.0 which was really 5.8.0
plus a bunch of patches.  I suspect that one of those patches is causing
this behaviour, enabling Devel::Cover to check the coverage of your
CHECK blocks.  You'll notice that your patch effectively brings
test_output/cover/special_blocks.5.008 up to
test_output/cover/special_blocks.5.008001.

> IF the expected output is wrong, I have provided a patch of the 
> test_output/cover/special_blocks.5.008 golden file.

So, I won't apply this patch, since it would break every standard 5.8.0
installation, but thanks very much for taking the trouble to create it.

And the good news is that you can safely use Devel::Cover, with the
added bonus of getting your CHECK blocks covered.

> I dont have a patch if the code under test is wrong, wouldnt even have a 
> clue where to start - I ran t/aspecial_blocks under Devel::ptkdb, and 
> realised I'd need to dig a lot deeper to find out where the code goes...
> 
> Can anyone give me a hint to track the code for a CHECK block? Do I have 
> to trace the dynamically generated command maually ?

If you are still interested, the code in question is in Cover::report(),
the section that starts "if (exists &B::check_av)".  In a standard 5.8.0
that would be false.  In 5.8.1 and, it would seem, RH9 5.8.0 it is true.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to