Test::Builder appends all Ok's to a structure it can return via
$tb->details. These Ok's have the fields 'ok' and 'actual_ok'. 'actual_ok'
is the true/false value passed to $tb->ok, 'ok' is adjusted to be true if
the test was run under TODO.

https://metacpan.org/source/EXODIST/Test-Simple-1.001014/lib/Test/Builder.pm#L845

The bug is in subtest handling. When you start a subtest you essentially
create a new Test::Builder singleton, and the TODO state is clear int he
new one, but it has a field 'parent_TODO' that gets set. This is used to
ensure that failures in a subtest when the parent has TODO set do not count
as actual failures.

The problem is that parent_todo is not considered when setting the OK's in
the details in subtests. That means if a subtest ok fails, and the parent
is in todo, the 'ok' and 'actual_ok' are both set to false.

The fix is easy, just change line 845 to look at parent_TODO. However this
breaks Test::ClassMoose because it uses details to verify its results.
https://metacpan.org/source/DROLSKY/Test-Class-Moose-0.67/t/basic.t#L55

I spoke with autarch about this test since he is the current maintainer. He
agrees with me that 'ok' should be true in that test, and that this is
probably a bug.

I have not yet figured out what else this may break on cpan, I will try to
do that tomorrow.

*What I am looking for from cpan-workers:*

1) Do you think this is actually a bug, or does it work as you think it
should?
2) Even if we all agree it is a bug, can we fix it, or do we need to
preserve it to avoid breaking things?

-Chad

Reply via email to