On Sat, May 17, 2008 at 11:20 AM, Michael G Schwern <[EMAIL PROTECTED]> wrote:
> Andreas J. Koenig wrote:
>>>>>>>
>>>>>>> On Sat, 17 May 2008 07:35:27 -0500 (CDT), David Fleck
>>>>>>> <[EMAIL PROTECTED]> said:
>>
>>  df> I hope someone can help out this novice test writer.  I have a module
>> that  df> runs several test scripts, and recently they have started to fail
>> on some  df> tester's machines.  The tests work fine for me, and I can't see
>> anything  df> in the Test::More documentation that tells me what's going on.
>>
>> It seems like Test::More broke between 0.74 and 0.78. I've seen the
>> same pattern on Slay-Makefile-Gress.
>
> Without any further information, all I can do is guess, but this is likely
> Test::More not breaking but fixing a bug and revealing a hidden failure.
> http://groups.google.com/group/perl.qa/browse_thread/thread/6ce3cc2762ab030c

As referenced by Michael, this was not Test::More that broke. Instead,
it got fixed of the "BEGIN { use_ok }" bug that ran silently before
planning, silently succeeding whether or not it failed.

This bug had some far reaching impacts because the usage below turned
to be very common:

    use Test::More;

    plan tests => $num_tests;

    BEGIN { use_ok 'Foo' } # this one did not enter the test count

    ok(1);
    ...

As discussed at length, the correct version (which happens to work
with the buggy and fixed Test::Builder) is:

    use Test::More;

    BEGIN { plan tests => $num_tests; }

    BEGIN { use_ok 'Foo' } # now this one should enter the test count

    ok(1);
    ...

Obviously, that bug should never have happened, so that usage would
have been readily flagged as flawed and corrected before distribution
release. But things are not perfect and, as we don't aim for bug
compatibility, the bug got fixed, demanding the minor adjustment of
the flawed code in the wild that relied on this defect.

>
> --
> 52. Not allowed to yell "Take that Cobra" at the rifle range.
>    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
>           http://skippyslist.com/list/
>

Reply via email to